Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 428 Bytes

structural_directives.md

File metadata and controls

16 lines (11 loc) · 428 Bytes

Structural Directives

Angular's structural directives change the DOM layout by adding and removing DOM elements. For example:

<div *ngIf="hero">{{ hero }}</div>

<div *ngFor="let hero of heroes">{{ hero }}</div>

<div [ngSwitch]="status">
  <template [ngSwitchWhen]="'in-mission'">In Mission</template>
  <template [ngSwitchWhen]="'ready'">Ready</template>
  <template ngSwitchDefault>Unknown</template>
</div>