I got this code:
ng-class="{selectedHeader: key == selectedCol}"
It works but I would like too add the 'key' value as a class too, Ive tried:
ng-class="[{selectedHeader: key == selectedCol}, key]"
But that wont work, does anyone know how to solve this?
If you always want key
to be added as a class:
ng-class="{selectedHeader: key == selectedCol, key: true]"
or you can just put it into a class
attribute with {{}}
interpolation.
ng-class="{selectedHeader: key == selectedCol}" class="{{key}}"
Just for completeness, if you only want to include it if it's equal to selectedCol
:
ng-class="{selectedHeader: key == selectedCol, key: key == selectedCol}"