Answers for "using ngif with ngclass"

1

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

Browse Popular Code Answers by Language