Currently, I have the following code snippet:
<ng-container *ngIf="someCondition">
<ng-template [ngIf]="cd.typedType === 'first'" [ngIfElse]="Second">
<div class="row">
first
</div>
</ng-template>
<ng-template #Second>
<div class="row">
second
</div>
</ng-template>
</ng-container>
This code is functional and works as intended. I am now wondering if there is a way to implement an else if statement. Is it possible to create something like this:
<ng-container *ngIf="someCondition">
<ng-template [ngIf]="cd.typedType === 'first'" [ngIfElseIf]="cd.typedType === 'second'" [ngIfElse]="cd.typedType==='third'">
<div class="row">
first
</div>
</ng-template>
<ng-template #Second>
<div class="row">
second
</div>
</ng-template>
<ng-template #Third>
<div class="row">
third
</div>
</ng-template>
</ng-container>
In essence, is there a way to toggle between three different templates using a basic if/else-if/else structure?