angularjs - angular multiple boolean conditions with associated classes -


this question has answer here:

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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -