In vue we can use conditional rendering like this:
<div v-if="condition1">Condition1 is true</div>
<div v-else-if="condition2">Condition2 is true</div>
<div v-else-if="condition3">Condition3 is true</div>
<div v-else>All of the above conditions are false</div>
How can I achive a similar functionality in angular 10?
I know that angular has *ngIf directive but as far as i know we can only achieve if; else with it and no more. I looked around and looks like I will have to implement a directive, but have no clue how to start. Any help is appreciated.
EDIT: Tried using ngSwitch.
<ng-container [ngSwitch]="true">
<div *ngSwitchCase="true">Condition1 is true</div>
<div *ngSwitchCase="false">Condition2 is true</div>
<div *ngSwitchCase="true">Condition3 is true</div>
<div *ngSwitchDefault>All of the above conditions are false</div>
</ng-container>
Gives:
Condition1 is true
Condition3 is true
Instead of just
Condition1 is true