Skip to content

Instantly share code, notes, and snippets.

@zenius
Created May 31, 2019 12:25
Show Gist options
  • Save zenius/a2b8ab1736eb20a573ddc585f56b7921 to your computer and use it in GitHub Desktop.
Save zenius/a2b8ab1736eb20a573ddc585f56b7921 to your computer and use it in GitHub Desktop.
The following classes are added to, or removed from, input fields:
ng-untouched The field has not been touched yet
ng-touched The field has been touched
ng-pristine The field has not been modified yet
ng-dirty The field has been modified
ng-valid The field content is valid
ng-invalid The field content is not valid
ng-valid-key One key for each validation. Example: ng-valid-required, useful when there are more than one thing that must be validated
ng-invalid-key Example: ng-invalid-required
The following classes are added to, or removed from, forms:
ng-pristine No fields has not been modified yet
ng-dirty One or more fields has been modified
ng-valid The form content is valid
ng-invalid The form content is not valid
ng-valid-key One key for each validation. Example: ng-valid-required, useful when there are more than one thing that must be validated
ng-invalid-key Example: ng-invalid-required
The classes are removed if the value they represent is false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment