Using structural directives

In the preceding section, we looked at the HeaderComponent. However, we skipped some details about its template. The HeaderComponent uses what is known as a structural directive:

<li *ngFor="let link of links"> 
   // ... 
</li> 

Structural directives are responsible for HTML layout. They shape or reshape the DOM's structure, typically by adding, removing, or manipulating elements.

Please refer to the documentation at https://angular.io/guide/structural-directives to learn more about structural directives.

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.