angularjs - angular multiple boolean conditions with associated classes -
this question has answer here:
- adding multiple class using ng-class 11 answers
i'm trying have different classes based on state, how's possible have different classes based on different conditions?
<i ng-class="'icona': state == 100, 'iconb': state == 200, 'iconc': state == 300"></i>
i think might missing curly brackets inside double quotes - try this?
<i ng-class="{ 'icona': state == 100, 'iconb': state == 200, 'iconc': state == 300 }"></i>
we did similar worked us:
<button class="date-picker__day" ng-class="{ 'date-picker__day--this-month': ctrl.isactivemonthforday(day), 'is-selected': ctrl.isselectedday(day), 'is-active': ctrl.isactiveday(day), 'is-today': ctrl.istoday(day), 'is-disabled': !ctrl.isdateallowed(day), }"></button>
Comments
Post a Comment