Quantcast
Channel: Angular: conditional class with *ngClass - Stack Overflow
Viewing all articles
Browse latest Browse all 27

Answer by Waleed Shahzaib for Angular: conditional class with *ngClass

$
0
0

You can use [ngClass] or [class.classname], both will work the same.
[class.my-class]="step==='step1'"

   OR

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

Both will work the same!


Viewing all articles
Browse latest Browse all 27

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>