Answers for "angular ngif classe"

CSS
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

ngif add class

[ngClass]="{'my-class': step === 'step1'}"
Posted by: Guest on June-11-2020

Browse Popular Code Answers by Language