Home > Blockchain >  How to use ngif condition in angular
How to use ngif condition in angular

Time:02-24

Approve and Publish Important! You're about to approve dustry Formile Deliverable Content to render when condition is true. -->

div

CodePudding user response:

You can use like this:

<div  *ngIf="your condition"></div>

CodePudding user response:

if you use simply if condition

<div *ngIf="condition">
   Condition content
</div>

if you use if with else condition

<div *ngIf="condition; else secondCondition">
   Condition content
</div>

<ng-template #secondCondition>
  secondCondition content
</ng-template>
  • Related