How to use NgClass in angular?
NgClass The NgClass directive allows you to set the CSS class dynamically for a DOM element. There are two ways to use this directive, the first is by passing an object literal to the directive. You can use NgClass using below syntax [ngClass]="{'text-success':true}" When using an object literal, the keys are the classes which are added to the element if the value of the key evaluates to true. So in the above example, since the value is true this will set the class text-success onto the element the directive is attached to. The value can also be an expression , so we can re-write the above to be. [ngCl...