Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 5fd42b6

Browse files
committed
docs(form): clarify what $setPristine does
1 parent ce35712 commit 5fd42b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ng/directive/form.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ function FormController(element, attrs, $scope, $animate, $interpolate) {
252252
* @description
253253
* Sets the form to its pristine state.
254254
*
255-
* This method can be called to remove the 'ng-dirty' class and set the form to its pristine
256-
* state (ng-pristine class). This method will also propagate to all the controls contained
257-
* in this form.
255+
* This method sets the form's `$pristine` state to true, the `$dirty` state to false, removes
256+
* the `ng-dirty` class and adds the `ng-pristine` class. Additionally, it sets the `$submitted`
257+
* state to false.
258+
*
259+
* This method will also propagate to all the controls contained in this form.
258260
*
259261
* Setting a form back to a pristine state is often useful when we want to 'reuse' a form after
260262
* saving or resetting it.

0 commit comments

Comments
 (0)