if statement angular template code example
Example 1: ngIf else
content_copy
<div *ngIf="condition; then thenBlock else elseBlock"></div>
<ng-template #thenBlock>Content to render when condition is true.</ng-template>
<ng-template #elseBlock>Content to render when condition is false.</ng-template>
Example 2: ng if
<div *ngIf="condition">