AngularJS Validations

The Angular Form has properties  which represent its state they are

  •    $pristine: Boolean true if the form/input has not been used yet.
  •    $dirty: Boolean true if the form/input has been used.
  •    $valid: The form content is valid
  •    $invalid: The form content is not valid.
  •    $submit: The form is submitted.

{ajs-validation}

 

1. How to write validation for Email?

{ajs-emailvali}

 

2. How to apply CSS classes?

CSS classes are added to forms and input fields depending on their state.

{ajs-class}