Angularjs Examples

AJS Examples


AngularJS Form Validation

In AngularJS $invalid, $valid and $error property is used to validate form fields (input, textarea and select) client-side. Find AngulaJS ng-form Properties like $valid, $invalid, $dirty, $error from below list.

Syntax

AngulaJS Form Validation Properties

PropertyDescription
$validIt is used to check inputs are valid or not.
$invalidIt is used to check inputs are invalid or not.
$pristineIt is used to check inputs are unmodified by the user or not.
$dirtyIt is used to check inputs are modified by the user or not. Its just revers of pristine.
$errorThis contains collection of invalid control's input, if a validation fail it return true, otherwise false.

AngularJS Form Validation Example

See Live Example