Check out example codes for "conditional classes angular". It will help you in understanding the concepts better.

Code Example 1

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

Code Example 2

<div [ngClass]="{'message': info.priority < 10,
                 'warn': info.priority > 10 && info.priority < 20, 
                 'error': info.priority > 30}">

{{info.text}}

</div>

Code Example 3

[ngClass]="(step=='step1')?'my-class1':'my-class2'"

Code Example 4

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

Code Example 5

<div 
  [className]="isActive ? 'active' : 'inactive'">
</div>

Learn ReactJs, React Native from akashmittal.com