@workInProgress @ngdoc overview @name Developer Guide: Templates: Understanding Angular Validators @description Angular validators are attributes that test the validity of different types of user input. Angular provides a set of built-in input validators: * {@link api/angular.validator.phone phone number} * {@link api/angular.validator.number number} * {@link api/angular.validator.integer integer} * {@link api/angular.validator.date date} * {@link api/angular.validator.email email address} * {@link api/angular.validator.json JSON} * {@link api/angular.validator.regexp regular expressions} * {@link api/angular.validator.url URLs} * {@link api/angular.validator.asynchronous asynchronous} You can also create your own custom validators. # Using Angular Validators You can use angular validators in HTML template bindings, and in JavaScript: * Validators in HTML Template Bindings
* Validators in JavaScript
angular.validator.[validator_type](parameters)The following example shows how to use the built-in angular integer validator:
angular.validator('your_validator', function(input [,additional params]) {
        [your validation code];
        if ( [validation succeeds] ) {
                return false;
        } else {
                return true; // No error message specified
                          }
}
Note that this validator returns "true" when the user's input is incorrect, as in "Yes, it's true,
there was a problem with that input". If you prefer to provide more information when a validator
detects a problem with input, you can specify an error message in the validator that angular will
display when the user hovers over the input widget.
To specify an error message, replace "`return true;`" with an error string, for example:
      return "Must be a value between 1 and 5!";
Following is a sample UPS Tracking Number validator: