28 questions
0 votes
0 answers
46 views
View is not getting updated even after model is changed in filterTaskList but the same view is getting updated for deleteTask method in Angular
In the below code when deletedTask is called view is getting updated properly but when filterTaskList is called it gives the proper response but the same is not refecting on UI export class ...
0 votes
1 answer
2k views
How to deal with required component inputs in Angular
I'm working on a web application that uses Angular (v16) as a framework. I have some issues with the way Angular initializes data for components. I often define components which require certain data ...
1 vote
1 answer
307 views
Unnecessary call of ngDoCheck() hook in Angular, why this happens?
Why does ngDoCheck() hook gets called when I focused out from an tag? Here I've add one <input> tag in app.component.html with [(ngModel)]="text" associates to it. I can understand ...
0 votes
2 answers
190 views
Why the content is not displaying when ng-content is used?
We know that the app-root component selector is used in the index.html file. So I placed some content between the selector. So to access the content I used ng-content inside the app-root HTML file. ...
0 votes
2 answers
1k views
Cannot read properties of this object values of parent component to child component function in angular
I'm calling a function declared in parent component in the child component in the form of callback. Parent Component translation-editor.component.ts export class TranslationEditorComponent implements ...
0 votes
2 answers
885 views
Destroyed component's properties are accessible via subscription - how?
I have this example stackblitz where I set an "id" for a component which you can create and destroy via a checkbox. Each time you create a new instance of the component, it is given an ...
1 vote
1 answer
413 views
Change Selector of Component coming from Library
Context I am working on a user interface library - which in itself is consuming another Angular Library which provides own components (for the sake of the example let's assume it's the Angular ...
1 vote
1 answer
281 views
Can we implement logic for all the Angular component ngAfterViewInit method?
All, I am looking a generic way to implement ngAfterViewInit method for all the components in a big web application. The reason is we need to track each page's loading time, so in order to do this, I ...
0 votes
1 answer
1k views
angular directive load component inside my new div created instead of outside
I have various tooltips, so I decided to load them using directive. it works fine. But the thing is it's not loading inside the host or appended div. without loading the component with created child ...
8 votes
1 answer
3k views
What happen if i use ngOnInit method without implementing OnInit interface
Can anyone please tell me what will happen if I don't implement onInit interface and still using ngOnInit component lifecycle inside a component? Since I used ngOnInit lifecycle hook without ...
1 vote
2 answers
3k views
Real UseCases for ngDoCheck (Angular9)
I am a beginner in Angular & learning by myself and i have stucked in ngDoCheck life cycle method According to Documentation: Detect and act upon changes that Angular can't or won't detect on ...
0 votes
1 answer
654 views
Angular Behavior Subject in service is getting messed up when initializing two of the same components
I created a component which is called sidebar. That component has let's say 2 inputs, sideBarMode and sideBarSide. In the app.component I add this component like this <sidebar [sideBarMode]="'...
0 votes
0 answers
1k views
Merge two observable in ngAfterViewInit()
This bug is related with this.events$ initialized in ngOnInit() This question is very similar to others but still slightly different when it comes to execution time. I have simple zip to merge two ...
0 votes
1 answer
82 views
making multiple http call after Switching between components
I have one query which is bit complex for me to explain but do ask me if you need any further details... Angular version: 8. Subject : issue while Switching components is circular. Like from ...
0 votes
1 answer
598 views
NgOnInit called twice
I have a page that is behind a guard, and on the ngOnInit I usually do a subscription to a context management server that consists of first a post to create a subscription then opening a websocket ...