I have some CSS classes that can have multiple names, how do I pass these names to ngClass?
The following is an example that doesn't work. How do I pass itemName
to ngClass
?
<div [ngClass]="isItem ? 'item {{itemName}}' : 'noItem {{itemName}}'"> </div>
Template interpolation is not possible inside the
[ngClass]
directive, just remove the brackets and concatenate the variable with the string.