angularjs - Several conditions for ng-class -


is ok write this?

<button href="#" ng-class="{'disabled' : form.mail.$invalid && form.firstname.$invalid }"></button> 

i thought right, doesn't work. have form, , need disable send button if these conditions aren't ok.

if write 1 condition, works.

you can use (, ) on condition:

ng-class="{'disabled': (form.mail.$invalid && form.firstname.$invalid)}" 

jsfiddle demo


as side note, far know code should works well.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -