angular.validator.url
Description
Use phone validator to restrict the input URLs.
Usage
In HTML Template Binding
<input type="text" ng:validate="url"/>
In JavaScript
angular.validator.url(value);
Parameters
- value –
{string}
– value to validate
CSS
ng-validation-error
Example
Enter valid phone number:
<input name="text" value="http://example.com/abc.html" size="40" ng:validate="url" >
it('should invalidate url', function(){
var n1 = element('.doc-example :input');
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
input('text').enter('abc://server/path');
expect(n1.attr('className')).toMatch(/ng-validation-error/);
});