Check out example codes for "conditionally assign a css class angular 9". It will help you in understanding the concepts better.

Code Example 1

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

Code Example 2

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

Code Example 3

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

{{info.text}}

</div>

Learn ReactJs, React Native from akashmittal.com