From chrome://newtab/
The key part of validation in Angular is :
the ngModelController
since it controls
the logic of passing values back and forth between the DOM and the scope.
In versions before 1.3,
we were able to implement custom validations by using ngModelController
and it’s $formatters
and $parsers
pipeline
These two properties are arrays,
that act as pipelines that get called when certain things happen.
These certain things are:
Model to view update - Whenever the bound model changes, all functions in $formatters
are called one by one, in order to format the value and changes it’s validity state.
View to model update - Whenever the user interacts with a form control, it calls the ngModelController’s $setViewValue
method, which in turn calls all functions of the $parsers
array in order to convert the value and also change it’s validity state accordingly.