Skip to content
Nelson Omuto edited this page Aug 25, 2014 · 1 revision

Validation Type

A configuration object that is processed to create an angular directive which you may then re-use in your application for form validation.

The gateway into using angular-ui-form-validation is either by re-using an existing validation type or creating an instance of a one in your scope controller that you may tailor to the custom fit your requirements. The validation type contains the following three properties: customValidationAttribute, errorMessage, validator.

customValidationAttribute

The name of the directive generated from a validation type.

errorMessage

The message the validation type directive will display when the validator returns false. The value passed can either be a string or a function in which case additional logic is required to display a message based on the value attributed to the directive. An example is a directive for max length, whereby the directive will be attributed an arbitrary value and the error message displays said value.

validator

A function that is evaluated on an input element change event. It returns a boolean based on whether the entered value is valid or not.