This provider is used to configure how input errors are displayed.
A special function called traverser is used to traverse DOM tree
beginning with <input> element. This function should return target element to which
list of error messages is appended. Default traverser will use input's parent element
to append list of error messages. You can change this behavior by providing your
own traverser.
Here's the list of built-in languages:
- English (
en) - Russian (
ru)
If you need to provide another language you can do so by implementing your own StringDictionary.
Also, I will be glad to add your translation to the library itself. Here's the languages registry file. Fork it, add your language to it and submit a pull request. Language code must be in proper IETF format.
Instructs library to use specified traverser.
{function} traverser
Callable traversing function with the following signature: function({jQuery} $inputElement).
The $inputElement is the <input> element from which you should start traversing.
You must return target element to which list of error messages will be added later.
Example:
For example, if you want to decorate not the input element itself, but it's parent element, you can use this code:
formValidationErrorsProvider
.useTraverser(function($inputElement) {
return $inputElement.parent();
})
;Actually, this is the default implementation.
Instructs library to use specified language.
{string} language
Name of the built-in language to use.
See the [list of supported languages][supported-languages].
Sets language dictionary to use.
{object} dictionary
A dictionary object.
Specifies custom implementation of error list renderer to be used instead of default one.
{object} errorListRenderer
Custom implementation of error list renderer.
Return an instance of default error list renderer that can be further configured or modified.
No input.
An instance of DefaultErrorListRenderer.
Builds list of errors from constraints and constraint parameters.
{object} constraints
Constraints for this input element.
{object} constraintParameters
Constraint parameters for this input element.
List of errors.