Structural directives

Structural directives deal with modifying elements in the DOM by adding new elements, removing existing elements, and replacing existing elements with new elements. The following markup shows two structural directives: *ngFor and *ngIf:

<div *ngFor="#todo of todos"></div> 
<todo-item *ngIf="selectedTodo"></todo-item>

*ngFor iterates through each item in the todos collection and adds a div tag for each item. And *ngIf renders <todo-item> only if selectedTodo is available.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.153.69