AngularJS Directives

AngularJS Filters and Elements

AngularJS Tutorials

AngularJS form Directive

AngularJS form Directive



AngularJS is used to change the default behavior of the form element. In AngularJS, forms are given certain new properties. These properties are described by the current state in which the form is present.


Form States are:-


  1. $pristine - No fields have been modified yet.
  2. $dirty - One or more have been modified
  3. $invalid - The form content is not valid
  4. $valid - The form content is valid
  5. $submitted - The form is submitted

All of these properties above have boolean values i.e, true or false.

In AngularJS, forms have given certain classes to style it when the state changes.


Form classes are:-


  1. ng-pristine - No fields have not been modified yet
  2. ng-dirty - One or more fields have been modified
  3. ng-valid - The form content is valid
  4. ng-invalid - The form content is not valid
  5. ng-valid-key - One key for each validation. Example: ng-valid-readonly.
  6. ng-invalid-key Example: ng-invalid-required.

Code Explanation

All Tutorials related to AngularJS Filters and Elements

All Sections related to AngularJS