Angular ngSwitch

html:

<div [ngSwitch]="dietSelection">
  <p *ngSwitchCase="'veg'">Vegetarian</p>
  <p *ngSwitchCase="'spicy'">Spicy</p>
  <p *ngSwitchDefault>Standard diet</p>
</div>

Leave a Reply

Your email address will not be published. Required fields are marked *