Question: how to use ngclass in angular 8?
Answer: Adding NgClass Directive on HTML Template in Angular 8|9 Go to app. component. html template and add the NgClass directive as mentioned below. In the above example, we are mapping cars name to apply the dynamic color classes, we declared NgClass object expression to apply the class.