497 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
1
answer
151
views
Change detection not working for child input
I thought @input was supposed to set off the change detector when it is used? When I use the mask input to "disable" this component from a parent component, it just keeps spinning with mat-...
1
vote
1
answer
139
views
What to do when ngOnChanges does not detect a change?
I am using Angular 18.
I have an array of "containers" containing, beside other info, an array of "products" each. I use @for to show a container-component for each container, and ...
1
vote
1
answer
299
views
reload component in Angular 19 with signals
My reload component:
import {ChangeDetectionStrategy, Component, input, output, resource} from '@angular/core';
import {ErrorService} from "../error.service";
@Component({
selector: 'a50-...
0
votes
0
answers
16
views
ExpressionChangedAfterItHasBeenCheckedError when using ViewChildren and QueryList [duplicate]
I need to update a css class in a component whenever it is added. Therefor I have a query list on my main component so I can listen to changes to all child components:
@ViewChildren(...
1
vote
2
answers
56
views
How to detect view refresh in Angular?
I have a component that displays dynamic, read-only data. For example:
<div>{{getText()}}</div>
I noticed that getText is being invoked over and over by Angular, even if there is ...
1
vote
1
answer
35
views
How to check if the passed reference is an instance of a particular ViewChild Reference in Angular
I have a viewchild ref in my .ts file like,
@ViewChild('someDialog') someDialog: ElementRef;
and in the .html file, I'm passing the reference back to a function like,
<abc-dialog #someDialog (...
1
vote
1
answer
83
views
Is zonejs used by plain angular click events?
My question is about angular change detection and zonejs: is zonejs used by the (click) event below?
@Component({
template: `
<button (click)="changeName()">Change name</...
1
vote
1
answer
674
views
Angular Zoneless: Changing property value for an object-based signal unexpectedly updates the view
I have an Angular v18.2 application that uses zoneless change detection:
export const appConfig: ApplicationConfig = {
providers: [provideExperimentalZonelessChangeDetection(), provideRouter(...
2
votes
1
answer
232
views
If I use Map.get('key1') in angular template, does the change detection mechanism check the map value every cycle?
I know it is not a good practice to call expressions from a template in angular, because angular cannot predict whether the return value of a function has changed, so it needs to execute the function ...
5
votes
1
answer
2k
views
Can I still use ngChanges with signals?
With the traditional @Input() decorator, one can use the ngChanges to do something if the value change. In this case, I'm using a component in the ng-bootstrap modal. The modal contains a form. When ...
1
vote
0
answers
41
views
angular: subscribe changes on a part of a (complex, hierarchical) component input
I'm creating a component that has a rather complex, nested configuration
export type LayerGroup = {
name: string;
layers: Array<VectorLayerDefinition | TileLayerDefinition | LayerGroup>;
...
1
vote
1
answer
92
views
ngTemplateOutlet directive handler fires multiple times
There is a simple Angular web app that uses ng-template. It uses ngTemplateOutlet directive. A handler method (loadtemplate) is set for this directive, but this method is called multiple times when a ...
1
vote
0
answers
162
views
ViewChild change detection throws ExpressionChangedAfterItHasBeenCheckedError
I have custom Angular Component modal-component that serves as a proxy for MatModalDialog with ngTemplateOutlet as body for mat-dialog-content.
<mat-dialog-content class="modal-dialog-medium&...
-1
votes
2
answers
42
views
Angular (boolean value=isEdit) Value Not Updating in subscribe Callback
I'm encountering an issue with updating a component property (isEdit) within the subscribe callback of an event emitter in my Angular application.
Context:
I have a CreateComponent responsible for ...
2
votes
2
answers
663
views
Confusing Angular behaviour in *ngFor loop
I'm a bit confused over the behaviour of this loop in Angular:
A simple *ngFor loop over an array of 5 fields
<div *ngFor="let field of this.fields" >
<div class="block"&...