Questions tagged variables

Explore the latest questions and answers asked by our top developers.

Dynamically change less variable for dark theme in Angular

I hope it is possible. Need to dynamically change less variable for using dark theme. The code is below: @theme: dark; @colors: { primary-violet-light: #608cef; primary-violet-dark: #031d58; } @primary-violet: @colors[[email protected]{theme}]; // have to be #031d58 But even it doesn’t work. The error is in the last row. "[email protected]{theme}" have to be primary-violet-dark but it doesnt. […]

By Illia Haponov
Categorized as angular, darkmode, javascript, less, variables Tagged , , , ,

concatenate variables in angular property element

I comment, and looked here and I can not find the solution, my problem is the following: in my html template in angular, I need to pass a series of data to the metadata property of a button, I can’t get the correct way to successfully concatenate the variable that contains the value. this should […]

By Jonas Alvarado
Categorized as angular, html, variables Tagged , ,

What is the use of $ sign in Angular properties [duplicate]

What is the use of the property httpSubscription$ in this code sample below customersList: Customer[];httpSubscriptions$ = { customersList: null }; Source: Angular Questions

Angular material theming receive current theme variable

My question is how I can receive the variable of the current theme in my components scss. I know that I can declare mixins and parse the theme as a parameter to them, but when I do this, my styles would be included globally and not only in my component, because I would have to […]

By Niklas
Categorized as angular, angular-material, sass, themes, variables Tagged , , , ,

Add a locking meachnism

I am a total beginner and am struggling with the following problem. I have an html document and I want to use Ajax to limit the requests to a maximum of 10. How can I do this? Can anyone help me? <script> var mainApp = angular.module("geocoder", []); mainApp.controller(‘geocodingController’, function($scope) { $scope.location = { address: "Type […]

By cmonn
Categorized as ajax, angularjs, javascript, jquery, variables Tagged , , , ,

Dynamically calling variable

In Angular Component, I want to use different variables. Ex: export class AppComponent{ value1; value2; value3; value4; print(position) { console.log(this.(‘value’+position)); //position will have values like 1,2,3,4 and I want to access value1, value2,value3,value4 //variables accordingly. } } How to execute this? Source: AngularJS Questions

Angular Component variables returning undefined

I’m using Angular 10, and i’m havin issues to create a Input Component with ControlValueAccessor. I’m creating public vars and public arrow functions, and when I call the arrow function is returning undefined. Here is my .ts code: import { Component, forwardRef, Input } from ‘@angular/core’; import { ControlValueAccessor, FormControl, FormGroup, NG_VALUE_ACCESSOR } from ‘@angular/forms’; […]

Compare 2 variables with comma separated values in JavaScript [closed]

I have 2 variables say a=1,2,3,4 and b=1,2 , I want to compare these 2 variables and form a new variable with common values, please help me Source: Angular Questions

Dynamic String Interpolation for variable output in angular

I need to mix the answers of Quiz-Questions in random order. I have Question objects like: Question = { question: ‘what is the capital of Germany?’, answer1: ‘Berlin’, answer2: ‘London’, answer3: ‘Paris’, answer4: ‘Rome’ } Every time I display the Question in the template I generate a random array e.g. randomOrder = [3,2,0,1] I want […]

By Joe
Categorized as angular, string-interpolation, variables Tagged , ,

Why is Angular overwriting the original variable?

I’m new to Angular, so hopefully this will make perfect sense to someone out there, but I’ve been at it for hours now. export class QuizComponent implements OnInit { originalArray: IArray[] = []; tempArray: IArray[] = []; constructor( private fetchService: FetchService ) {} ngOnInit(): void { this.originalArray = this.fetchService.getData(); this.tempArray = this.originalArray } onWin() { […]

By hyena
Categorized as angular, overriding, typescript, variables Tagged , , ,
1 2 3 4

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us