Answers for "class ngif angular"

2

ngclass else

<p class="{{condition ? 'checked' : 'unchecked'}}">
<!-- or -->
<p [ngClass]="condition ? 'checked' : 'unchecked'">
<!--or -->
<p [ngClass]="[condition ? 'checked' : 'unchecked']">
Posted by: Guest on August-18-2021
0

how to write ngif in angular

content_copy
<div *ngIf="condition">Content to render when condition is true.</div>
Posted by: Guest on January-04-2022

Browse Popular Code Answers by Language