Angular ngIf

Basic syntax

html:

<div *ngIf="condition">Content to render when condition is true.</div>

if-else syntax

html:

<div *ngIf="condition; else elseBlock">Content to render when condition is true.</div>
<ng-template #elseBlock>Content to render when condition is false.</ng-template>

Leave a Reply

Your email address will not be published. Required fields are marked *