docs(form): clarify what $setPristine does

This commit is contained in:
Martin Staffa
2016-07-22 21:33:33 +02:00
parent ce3571280d
commit 5fd42b6cb8
+5 -3
View File
@@ -252,9 +252,11 @@ function FormController(element, attrs, $scope, $animate, $interpolate) {
* @description
* Sets the form to its pristine state.
*
* This method can be called to remove the 'ng-dirty' class and set the form to its pristine
* state (ng-pristine class). This method will also propagate to all the controls contained
* in this form.
* This method sets the form's `$pristine` state to true, the `$dirty` state to false, removes
* the `ng-dirty` class and adds the `ng-pristine` class. Additionally, it sets the `$submitted`
* state to false.
*
* This method will also propagate to all the controls contained in this form.
*
* Setting a form back to a pristine state is often useful when we want to 'reuse' a form after
* saving or resetting it.