An textarea with information binding:
<p>The estimation of the textarea field is:</p>
Definition and Usage
AngularJS alters the default conduct of
be that as it may, just if the
ng-model characteristic is present.
They give information authoritative, which implies they are a piece of the AngularJS display, also, can be alluded to, and refreshed, both in AngularJS capacities and in the DOM.
They give approval. Model: a
<textarea> component with
required property, 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 textarea elements.
Textarea fields have the accompanying states:
$untouchedThe field has not been contacted yet
$touchedThe field has been touched
$pristineThe field has not been altered 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
Textarea components are being alluded to by utilizing the estimation of the
<textarea> components inside an AngularJS application are given sure classes. These
classes can be utilized to style textarea components as per 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 altered yet
ng-dirtyThe field has been modified
ng-validThe field content is valid
ng-invalidThe field content isn't valid
ng-legitimate keyOne key for every approval. Precedent:
ng-legitimate required, helpful when there are mutiple thing that must be validated
The classes are evacuated if the esteem they speak to is
Apply styles for legitimate and invalid textarea components, utilizing standard CSS:
foundation shading: pink;
foundation shading: lightgreen;