Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

angular nested if else

<ng-container *ngIf="condition_01; then then_01; else else_01"></ng-container>
<ng-template #then_01>
    <ng-container *ngIf="condition_02; then then_02; else else_02"></ng-container>
    <ng-template #then_02>
        <div>Then 02 block content</div>
    </ng-template>
    <ng-template #else_02>
        <div>Else 02 block content</div>
    </ng-template>
</ng-template>
<ng-template #else_01>
  <div>Else 01 block content</div>
</ng-template>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #nested
ADD COMMENT
Topic
Name
2+3 =