Quantcast
Viewing all articles
Browse latest Browse all 26

Answer by Robert Leeuwerink for Angular: conditional class with *ngClass

to extend MostafaMashayekhi his answer for option two>you can also chain multiple options with a ','

[ngClass]="{'my-class': step=='step1', 'my-class2':step=='step2' }"

Also *ngIf can be used in some of these situations usually combined with a *ngFor

class="mats p" *ngIf="mat=='painted'"

Viewing all articles
Browse latest Browse all 26

Trending Articles