NgClass
Last updated
Was this helpful?
Last updated
Was this helpful?
A is a good way to add or remove a single class.
To add or remove many CSS classes at the same time, the NgClass directive may be the better choice.
Try binding ngClass to a key:value control object. Each key of the object is a CSS class name; its value is true if the class should be added, false if it should be removed.