Posted On: Feb 22, 2018
The ngIf is a built-in template directive that 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>"
Example-
<ul *ngFor="let person of people"
*ngIf="person.age < 30">
<li>{{person.name}}</li></ul>
Never Miss an Articles from us.
A decorator is the core concept when developing an angular framework with version 2 and above. It may become a core lang..
Components are just simple classes which are declared as components with the help of component decorators. It becomes e..
Here are the elements which are present in the component directory structure anf modules:-module.ts- in this, the angu..