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
Post a Comment