Validation Workflow
The 1-2-3's of validation
validity.validate(form)
is called- All the inputs within the form that have a validity directive are cached
- If the form has already been cached, then the list of inputs are retrieved from the cache
- A promise is created for each input
- Within each
input promise
, a promise is created for each of the input's rules - All the promises are resolved asynchronously
- Caveat: if the
required
rule is present, it runs first, with the input's other rules running after it passes
- The first
rule promise
that is rejected stops further processing of that input's rules - Once all promises have resolved, validation is complete
Updated less than a minute ago