Form properties

Description

We can access form properties in the format of

formName.inputFieldName.property

These properties enable us to react to the form.

Unmodified Form

This property is a boolean that tells us whether the user has modified the form. It is true if the user hasn't touched the form, and false if they have:

formName.inputFieldName.$pristine;

Modified Form

This property is a boolean that tells us if the user has modified the form.

formName.inputFieldName.$dirty

Valid Form

This property is a boolean that tells us whether the form is valid.

formName.inputFieldName.$valid

Invalid Form

This property is a boolean that tells us whether or not the form is invalid.

formName.inputFieldName.$invalid

Errors

The $error object contains all of the validations on a particular form and a record of whether they are valid or invalid.

formName.inputfieldName.$error




















Home »
  AngularJS »
    AngularJS Tutorial »




Introduction
Buildin Filters
Buildin Directives