In AngularJS, what’s the difference between ng-pristine and ng-dirty?
The ng-dirty class tells you that the form has been modified by the user, whereas the ng-pristine class tells you that the form has not been modified by the user. So ng-dirty and ng-pristine are two sides of the same story. The classes are set on any field, while the form has two properties, $dirty and $pristine. You can use the $scope.form.$setPristine() function to reset a form to … Read more