What are the state CSS classes provided by ngModel?

Posted by Jennifer | Updated on

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 stateIf trueIf false
Visitedng-touchedng-untouched
Value has changedng-dirtyng-pristine
Value is validng-validng-invalid

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers