| 1. |
Explain Ngif Directive ? |
|
Answer» The NGIF is a built-in template directive which is used to add or remove some parts of DOM. This addition or removal depends on the EXPRESSION being true or false. If the expression is evaluated to false, then the ngIf directive REMOVES the HTML element. If the expression is evaluated to be true, then the element gets ADDED to the DOM. Syntax:- *ngIf=”<condition>” The ngIf is a built-in template directive which is used to add or remove some parts of DOM. This addition or removal depends on the expression being true or false. If the expression is evaluated to false, then the ngIf directive removes the HTML element. If the expression is evaluated to be true, then the element gets added to the DOM. Syntax:- *ngIf=”<condition>” |
|