I'm attempting to apply a class conditionally to an element, but I'm struggling with the correct syntax.
I've experimented with the code below, but it's not functioning as expected:
ng-class="{foo: bar === "true"}"
The value of bar
is boolean.
Additionally, the element already has a class
attribute. Will adding foo
append it to the existing list of classes?