ng if for a ng for angular code example
Example 1: ng if
<ng-template [ngIf]="heroes" [ngIfElse]="loading">
<div class="hero-list">
...
</div>
</ng-template>
<ng-template #loading>
<div>Loading...</div>
</ng-template>
Example 2: ng if
<div *ngIf="condition">