build class on if angular code example
Example 1: conditional classes angular
<div
[className]="isActive ? 'active' : 'inactive'">
</div>
Example 2: Angular 8 ngClass If
[ngClass]="{1:'my-class1',2:'my-class2',3:'my-class4'}[step]"
<div
[className]="isActive ? 'active' : 'inactive'">
</div>
[ngClass]="{1:'my-class1',2:'my-class2',3:'my-class4'}[step]"