AngularJS | Form Validation

AngularJS performs form validation on the client-side. AngularJS monitors the state of the form and input fields (input, text-area, select), and notify the user about the current state. AngularJS also holds information about whether the input fields have been touched, modified, or not.
Form input fields have the following states:

  • $untouched: It shows that field has not been touched yet.
  • $touched: It shows that field has been touched.
  • $pristine: It represents that the field has not been modified yet.
  • $dirty: It illustrates that the field has been modified.
  • $invalid:It specifies that the field content is not valid.
  • $valid:It specifies that the field content is valid.

These all are the properties of the input field which can be either true or false.
Forms have the following states: