angular.validator.phone

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

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

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-live :input');
   expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
   input('text').enter('+12345678');
   expect(n1.attr('className')).toMatch(/ng-validation-error/);
  });