angular.validator.email
Description
Use email validator if you wist to restrict the user input to a valid email.
Usage
In HTML Template Binding
<input type="text" ng:validate="email"/>
In JavaScript
angular.validator.email(value);
Parameters
- value –
{string}
– value to validate
CSS
ng-validation-error
Example
Enter valid email:
<input name="text" ng:validate="email" value="me@example.com">
it('should invalidate email', function(){
var n1 = element('.doc-example :input');
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
input('text').enter('a@b.c');
expect(n1.attr('className')).toMatch(/ng-validation-error/);
});