The ngModel directive updates the form control with special Angular CSS classes to reflect it’s state. The various state CSS classes provided by ngModel is shown below in the tabular format,
Form control state | If true | If false |
---|---|---|
Visited | ng-touched | ng-untouched |
Value has changed | ng-dirty | ng-pristine |
Value is valid | ng-valid | ng-invalid |