adev/src/content/examples/structural-directives/src/app/app.component.html
Conditional display of hero
{{ hero.name }}
List of heroes
Expression is true and ngIf is true. This paragraph is in the DOM.
Expression is false and ngIf is false. This paragraph is not in the DOM.
Expression sets display to "block". This paragraph is visible.
Expression sets display to "none". This paragraph is hidden but still in the DOM.
<ng-template> element
{{ hero.name }}
Toggle hero
I turned the corner and saw {{ hero.name }}. I waved and continued on my way.
I turned the corner and saw {{ hero.name }}. I waved and continued on my way.
<select> with <span>
Pick your favorite hero (show sad) {{ h.name }} ({{ h.emotion }})
<select> with <ng-container>
Pick your favorite hero (show sad) {{ h.name }} ({{ h.emotion }})
<div *ngFor="let hero of heroes; let i=index; let odd=odd; trackBy: trackById" [class.odd]="odd">
({{ i }}) {{ hero.name }}
<ng-template ngFor let-hero [ngForOf]="heroes" let-i="index" let-odd="odd" [ngForTrackBy]="trackById"/>
({{ i }}) {{ hero.name }}
Pick your favorite hero
{{ h.name }} None of the above