Back to Developer Roadmap

Structural Directives

src/data/roadmaps/angular/content/[email protected]

4.01.0 KB
Original Source

Structural Directives

Structural directives are directives applied to an <ng-template> element that conditionally or repeatedly renders the content of that <ng-template>. If you just wrap elements in an <ng-template> without applying a structural directive, those elements will not be rendered.

In Angular, there are three standard structural directives:

  • *ngIf – conditionally includes a template depending on the value of an expression returned by a Boolean.
  • *ngFor – makes it simple to iterate over an array.
  • *ngSwitch – renders each matching view.

Visit the following resources to learn more: