Validation Workflow

The 1-2-3's of validation

  1. validity.validate(form) is called
  2. 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
  1. A promise is created for each input
  2. Within each input promise, a promise is created for each of the input's rules
  3. 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
  1. The first rule promise that is rejected stops further processing of that input's rules
  2. Once all promises have resolved, validation is complete