In this section we explain how to use validation directives and how they work with
ngFormController to provide a full validation framework.
ngForm) directive creates an instance of
ngFormController object manages whether the form is valid or invalid and whether it is pristine or dirty. Importantly, it works with
ngModelController to track each
ngModel field within the form.
ngModelController is created, it registers itself with the first
ngFormController it comes across as it traverses up its list of parent elements. This way, the
ngFormController knows what input directives it should track. It can check whether these fields are valid/invalid or ...