css - ng-model can i check its own value? -


i have been playing angular , in pickle. want check see if ng-model value greater 0 apply different css style. can done?

`<span ng-model="users2" ng-hide="!myvar" ng-class="{'test2': users2 > 0}"  style="font-size:28px; color:purple" >` 

any appreciated? thanks!

you did right

look @ jsbin

also @ ngclass documentation further examples.

if doesn't work problem.

edit:

i totally on seen mentioned in comments the ngmodel directive binds input, select, textarea (or custom form control) property on scope. on span doesn't , isn't defined

jsbin example


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -