An input field with information binding:
<p>The estimation of the information field is:</p>
Definition and Usage
AngularJS changes the default conduct of
in any case, just if the
ng-model characteristic is present.
They give information official, which implies they are a piece of the AngularJS display, what's more, can be alluded to, and refreshed, both in AngularJS capacities and in the DOM.
They give approval. Precedent: a
<input> component with
required characteristic, has the
$valid state set to
false as long as it is empty.
They likewise give state control. AngularJS holds the present condition of all input elements.
Input fields have the accompanying states:
$untouchedThe field has not been contacted yet
$touchedThe field has been touched
$pristineThe field has not been changed yet
$dirtyThe field has been modified
$invalidThe field content isn't valid
$validThe field content is valid
The estimation of each state speaks to a Boolean esteem, and is either
or on the other hand
Input components are being alluded to by utilizing the estimation of the
<input> components inside an AngularJS application are given sure classes. These
classes can be utilized to style input components as indicated by their state.
The following classes are added:
ng-untouchedThe field has not been contacted yet
ng-touchedThe field has been touched
ng-pristineThe field has not been adjusted yet
ng-dirtyThe field has been modified
ng-validThe field content is valid
ng-invalidThe field content isn't valid
ng-substantial keyOne key for every approval. Model:
ng-substantial required, valuable when there are mutiple thing that must be validated
The classes are expelled if the esteem they speak to is
Apply styles for legitimate and invalid information components, utilizing standard CSS:
foundation shading: pink;
foundation shading: lightgreen;