What is type narrowing?
The expression used in an ngIf directive is used to narrow type unions in the Angular template compiler similar to if expression in typescript. So *ngIf allows the typeScript compiler to infer that the data used in the binding expression will never be undefined.
@Component({selector: 'my-component',template: '<span *ngIf="user"> {{user.contact.email}} </span>'})class MyComponent {user?: User;}
February 08, 2022
365
Read more
What is Angular Framework?
November 04, 2022
AngularWhat is a Angular module?
November 03, 2022
AngularWhat are the steps to use animation module?
October 31, 2022
Angular