Quantcast
Viewing latest article 15
Browse Latest Browse All 26

Answer by Chaitanya Nekkalapudi for Angular: conditional class with *ngClass

with the following examples you can use 'IF ELSE'

<p class="{{condition ? 'checkedClass' : 'uncheckedClass'}}"><p [ngClass]="condition ? 'checkedClass' : 'uncheckedClass'"><p [ngClass]="[condition ? 'checkedClass' : 'uncheckedClass']">

Viewing latest article 15
Browse Latest Browse All 26

Trending Articles