ngClass
ngClassis an attribute directive used to modify the attributes of existing DOM elements- Use
ngClassto add or remove multiple classes - Binding
ngClassto an expression - An object with 1 or more key value pairs.
- Each key represents the CSS class, and the value determines the class should be rendered or not
- Key should be in single quote
<span [ngClass]="{
'glyphicon-star': isSelected,
'glyphicon-star-empty': !isSelected
}"></span>