Imprimer
  
<div *ngIf="test">
        <h2>Ma c</h2>
    </div>
 
    <template [ngIf]="brag">
        <div>
            <h2>I'm awesome!</h2>
        </div>
    </template>
 
    <div *ngFor="let name of names">
        <h2>{{name}} is awesome!</h2>
    </div>
 
    <div [ngSwitch]="whoIsAwesome">
        <h2> *ngSwitchCase="'Jennifer'">Jennifer is awesome!</h2>
        <h2> *ngSwitchCase="'Waleed'">Waleed is awesome!</h2>
        <h2> *ngSwitchCase="'Michael'">Michael is awesome!</h2>
    </div>
 
</ion-content>
<ul *ngFor="let person of people"
    [ngSwitch]="person.country">

  <li *ngSwitchCase="'UK'"
      class="text-success">
    {{ person.name }} ({{ person.country }})
  </li>
  <li *ngSwitchCase="'USA'"
      class="text-primary">
    {{ person.name }} ({{ person.country }})
  </li>
  <li *ngSwitchCase="'HK'"
      class="text-danger">
    {{ person.name }} ({{ person.country }})
  </li>
  <li *ngSwitchDefault
      class="text-warning">
    {{ person.name }} ({{ person.country }})
  </li>
</ul>`
Affichages : 1797