vendredi 27 février 2015

How to access html element name in array format inside an angularjs expression?

I am using ruby on rails devise for authentication. I need to validate the login form on client side. Devise uses user[email] as name attribute value. How do I use the same name in angularjs ng-show expression ?



<form ng-app="" ng-controller="validateCtrl" name="myForm" novalidate>
<input type="text" name="user[email]" ng-model="user" required>
<span ng-show="myForm.user[email].$error.required">Username is required</span>
</form>


user[email] does not work in angularjs ng-show expression.


Aucun commentaire:

Enregistrer un commentaire