Why does Angular Component variable update on service method call?

I have a service method as shown: import { Injectable } from ‘@angular/core’; import { of } from ‘rxjs’; import Employee from ‘../model/employee’; @Injectable({ providedIn: ‘root’ }) export class DataService { employees : Employee[] = [{ fName : ‘Sam’, lName : ‘Johnson’, age : 32, country : ‘USA’ },{ fName : ‘Raghav’, lName : ‘Sharma’, […]

By iJade
Published
Categorized as angular Tagged

Angular : Able to use a component from another module which is not being exported

I’m able to import a component from another module in routing which is not being exported. A routing module { path: ‘home’, component: DashComponent } B routing module { declarations: [DashComponent], } As seen in the above code, DashComponent is not being exported in B routing module but still I’m able to use it in […]

By iJade
Published
Categorized as angular Tagged

Able to use a component from another module which is not being exported

I’m able to import a component from another module in routing which is not being exported. A routing module { path: ‘home’, component: DashComponent } B routing module { declarations: [DashComponent], } As seen in the above code, DashComponent is not being exported in B routing module but still I’m able to use it in […]

By iJade
Published
Categorized as angular Tagged

Unable to set ${} in ngx Quill Editor

I’m using Quill Editor in my Angular application. While trying to insert text into the editor using the editor instance, normal text works fine. But if I use ${Name} it disappears when I read the value from the editor. Here is the code: const selec = editor.getSelection(); editor.insertText(selec.index, "${Name}"); Using the above code, value gets […]

By iJade
Published
Categorized as angular, ngx-quill, quill Tagged , ,

Set Value for FormArray with Different FormGroup

Here is how the code looks: ngOnInit() { this.myForm = this._fb.group({ name: [”, [Validators.required, Validators.minLength(5)]], products: this._fb.array([this.addProductA(),this.addProductB()]) }); } addProductA() { return this._fb.group({ id: [”, Validators.required], productId: [”], item: [”] }); } addProductB() { return this._fb.group({ id: [”, Validators.required], product: [”] }); } I’m able to add different form groups to form array but while […]

Angular directive with scope : @ not working

Here is my directive code which works fine: .directive(‘myGrid’,function(){ return { restrict:’E’, scope:{ info:’=info’ }, templateUrl : ‘/directiveGrid.html’ } }) Here is a codepen demo But if I change the scope like : .directive(‘myGrid’,function(){ return { restrict:’E’, scope:{ info:’@info’ }, templateUrl : ‘/directiveGrid.html’ } }) It doesn’t work. Here is the second demo Source: AngularJS […]

By iJade
Published
Categorized as angularjs, angularjs-directive Tagged ,

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
faq