angular/angular.js — pull request #1127 by pkozlowski-opensource (2012-07-07 17:27:14+00:00)
Title: Issue #856: add ability to reset a form to its pristine state

This is a fix for the (quite up-voted now) issue #856. The whole commit boils down to adding the $setPristine() method to both ng.directive:form.FormController and ng.directive:ngModel.NgModelController; tests are added as well.

Here is a jsFiddle that shows an issue: http://jsfiddle.net/pkozlowski_opensource/qT9pu/2/ (just type sth in a field and then delete it).

Here is another jsFillde with the issue fixed: http://jsfiddle.net/pkozlowski_opensource/2x8HD/4/ (just type sth in a field and then delete it and click on 'Revert edits').