angular.validator.phone

Description

Use phone validator to restrict the input phone numbers.

Usage

In HTML Template Binding

<input type="text" ng:validate="phone"/>

In JavaScript

angular.validator.phone(value);

Parameters

CSS

ng-validation-error

Example

Enter valid phone number: <input name="text" value="1(234)567-8901" ng:validate="phone" > it('should invalidate phone', function(){ var n1 = element('.doc-example :input'); expect(n1.attr('className')).not().toMatch(/ng-validation-error/); input('text').enter('+12345678'); expect(n1.attr('className')).toMatch(/ng-validation-error/); });