Here's a snippet of code for a form I'm working on:
<form name="registerForm" novalidate role="form">
<div class="row">
<div class="small-3 columns"><label for="pwd" class="right inline">Password:</label></div>
<div class="small-9 columns">
<label class="" ng-class="{'error': registerForm.pwd.$error.required && registerForm.pwd.$dirty}"><input type="password" id="pwd" name="pwd" ng-model="registerDetails.password" ng-required="true" /></label>
<small class="error" ng-show="registerForm.pwd.$error.required && registerForm.pwd.$dirty">Password Required</small>
</div>
</div>
</form>
In the code above, you'll notice the registerForm.pwd
variable, which combines the form name with the input name. Angular has added properties like $error
and $dirty
to this variable.
I'm wondering if there's a way for me to add my own properties to it, like registerForm.pwd.$notEqual
, perhaps through a directive?