options
function in module validity
options(settings);
options(settings);
Configure angular-validity's global option settings
Parameters
Param | Type | Details |
---|---|---|
settings (optional) | object | See Settings for a list of valid settings |
Settings
Setting | Type | Details | Default |
---|---|---|---|
cache | boolean | When angular-validity is called to validate a form, it traverses the DOM for the inputs that need to be validated. Caching these inputs once they are found makes subsequent validation calls significantly faster | true |
debug | boolean | Enable health checks on your angular-validity implementation. Reports are logged to the console at runtime | false |
event | string | The default validation event an input should bind to when not specified within the validity directive. Supported events: any standard DOM event (e.g., "blur", "change"). When using "watch", validation is triggered when the input's ng-model changes. | blur |
style | string | Built in support for framework validation styles. Supported frameworks: "Bootstrap3" | null |
Returns
options
- when a parameter is not passed into the function, it returns the existing options objectvalidity
- when a parameter is passed into the function, it returns the validity module (for chaining)
Usage
Call from within your project module's config
method:
angular.module("exampleApp", ["ttValidity"])
.config(["validityProvider", function (validityProvider) {
validityProvider.options({
// options
});
}]);
Examples
Example 01: debug and style
validityProvider.options({
debug: true,
style: "Bootstrap3"
});
Updated less than a minute ago