I originally had this, and it was easy: ng-class="response.name"
(Where response.namewas the evaluated expression.)
But now I'm trying to do this: ng-class="{response.name: true, tooltip: someExpression}"(so it is response.namealways present, but it tooltipdepends on the context.)
You see, I cannot have response.nameas a key in an object ... I know that. He just takes it as a string response.nameliterally and there is no rating. But I need a class tooltipthat will be applied conditionally. I do not know how to combine these needs!
At first, I tried just using a few attributes of the ng class, but it just ignored everything except the first one.
source
share