Relative Content

Tag Archive for angular

@if @else (or *ngIf) issue and change detection

I have a component that has conditional logic using an @if (or *ngIf) condition on a flag, e.g., @if (model.editable) or <ngContainer *ngIf=”model.editable”…>, in its html file, which displays one set of controls for the true condition and another for false.

trigger change detection for primitive attributs

It’s the first time that I’m going to use change detection onPush in my project.
I know that when we use this strategy, Angular will detect changes to input properties by comparing their object references, not their contents. If I add for example this code in a component using onpush, angular is not detecting the change, how can we resolve the problem ?

trigger change detection for primitive attributs

It’s the first time that I’m going to use change detection onPush in my project.
I know that when we use this strategy, Angular will detect changes to input properties by comparing their object references, not their contents. If I add for example this code in a component using onpush, angular is not detecting the change, how can we resolve the problem ?