ng-pristine ($ net)
Boolean True if the form / input is not yet in use ( not modified by the user )
ng-dirty ($ dirty)
Boolean True if using form / input ( user modified )
$ SetDirty (); Sets the mold into a dirty state. This method can be called to add the "ng-dirty" class and set the form to a dirty state (ng-dirty class). This method will propagate the current state to parent forms.
$ setPristine (); Sets the form to its pristine state. This method sets the form of $ pristine state to true, the state of $ dirty is false, removes the ng-dirty class and adds the ng-pristine class. In addition, it sets the $ submit parameter to false. This method will also apply to all controls contained in this form.
Setting the form back to its pristine state is often useful when we want to βreuseβ the form after saving or resetting it.
Dhyan Mohandas Sep 25 '17 at 10:18 2017-09-25 10:18
source share