web-profile

Angular ngSwitch

html:

<ng-container [ngSwitch]="dietSelection">
  <ng-container *ngSwitchCase="'veg'">Vegetarian</ng-container>
  <ng-container *ngSwitchCase="'spicy'">Spicy</ng-container>
  <ng-container *ngSwitchDefault>Standard diet</ng-container>
</ng-container>

Leave a Reply

Your email address will not be published.