angularjs - trying to use ng-class with multiple conditions -


i'm trying set ng-class work on div 2 conditions:

ng-class="(accounts.length == 1 && account.cardname =='cash') ? 'one-dash-cash' : ''"

and

ng-class="(accounts.length == 1 && account.cardname =='points') ? 'one-dash' : ''"

what's best way accomplish this? i've read shouldn't have logic in html, i'm not sure how this.

thanks in advance..

ng-class="{'one-dash-cash':accounts.length == 1 && account.cardname =='cash','one-dash':accounts.length == 1 && account.cardname =='points'}" 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -