I want to set an span 2 classes and one more with conditionality if item.qty is 0. I have this
<span ng-class="glyphicon,glyphicon-minus,{'notvisible': item.qty 0}"/>
But this dont work..i think this is not the sintax but i havent found anythink.
Why don't you just add those static classes in the usual way and only leave the conditional in an ng-class
, like this:
<span class="glyphicon glyphicon-minus" ng-class="{'notvisible': item.qty==0}"/>
Also, you forgot the compare-operator ==
(I added it in the above example).
If you only want to toggle the visibility of that element with the 'notvisible'-Class, I would even recommend you use the ng-show
-Directive like this:
<span ng-show="item.qty > 0" class="glyphicon glyphicon-minus" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With