Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

Angular If else

<div *ngIf="isValid;else other_content">
    content here ...
</div>

<ng-template #other_content>other content here...</ng-template>

<div *ngIf="isValid;then content else other_content">here is ignored</div>
<ng-template #content>content here...</ng-template>
<ng-template #other_content>other content here...</ng-template>

<div *ngIf="isValid;then content"></div>
<ng-template #content>content here...</ng-template>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Angular #If
ADD COMMENT
Topic
Name
8+1 =