I am trying to apply a css class to material icon like following:
<i ngClass="{task.isDone ? 'checked-icon material-icons' : 'material-icons'}">check_circle</i>
without condition it would look like this (which works):
<i class="checked-icon material-icons">check_circle</i>
I have a variable isDone in my component and I want to apply this extra checked-icon class only when that variable is true. But my conditional statement do not work.
What am I doing wrong?
P.S.: I tried following
<i ngClass="{task.isDone ? checked-icon material-icons : material-icons}">check_circle</i>
but it applied this extra class to every element regardless of value false