Reputation: 973
I have an element:
<div class="wrapper" > ... </div>
I know I can use angular to apply a class conditionally:
<div ng-class="{'wrapper-big': style.big}" > ... </div>
But I want to keep a static class and add 'big' using angular. Desired output:
<div class="wrapper big" > ... </div>
So the class big
is what I want to conditionally add.
Upvotes: 0
Views: 128
Reputation: 2219
you can use the class and ng-class attributes together.
<div class="wrapper" ng-class="{'big': /*CONDITION*/}" > ... </div>
Upvotes: 1
Reputation: 2220
use the array syntax of ng-class.
e.g.
<div ng-class="[style1, style2, style3]" > ... </div>
Here is an example - https://docs.angularjs.org/api/ng/directive/ngClass
Upvotes: 0