This structure's "valid state" won't be consider "true", as long as the required input field is empty:
<input name="myInput" ng-model="myInput" required>
<p>The structures' substantial state is:</p>
Definition and Usage
AngularJS changes the default conduct of the
Forms inside an AngularJS application are given sure properties. These properties depicts the present condition of the form.
Forms have the accompanying states:
$pristineNo fields have been changed yet
$dirtyat least one have been modified
$invalidThe structure content isn't valid
$validThe structure content is valid
$submittedThe structure is submitted
The estimation of each state speaks to a Boolean esteem, and is either
or then again
Forms in AngularJS keeps the default activity, which is presenting the structure to the server, if the activity quality isn't specified.
Forms are being alluded to by utilizing the estimation of the name attribute.
Forms inside an AngularJS application are given sure classes. These classes can be utilized to style shapes as indicated by their state.
The following classes are added:
ng-pristineNo fields has not been altered yet
ng-dirtyat least one fields has been modified
ng-validThe structure content is valid
ng-invalidThe structure content isn't valid
ng-substantial keyOne key for every approval. Model:
ng-legitimate required, helpful when there are mutiple thing that must be validated
The classes are expelled if the esteem they speak to is
Apply styles for unmodified (perfect) shapes, and for changed forms:
foundation shading: lightblue;
foundation shading: pink;