What are the state CSS classes provided by ngModel?
The ngModel directive updates the form control with special Angular CSS classes to reflect it's state. Let's find the list of classes in a 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 |