I have a HTML form[name="mainForm"] with many inputs.
When I modify an input the $scope.mainForm.$dirty becomes true (and that's right) but when I setPristine() a field I have previously modified ($scope.mainForm.firstName.$setPristine()) the whole form keeps in the $dirty state - ($scope.mainForm.$dirty is true).
I wish to know where I'm doing wrong.
http://plnkr.co/edit/4ksaQwyKcEV2BoDbiECz?p=preview
If I input the firstName field and then:
$scope.mainForm.firstName.setPristine();
the whole form should be $pristine because firstName was the only field that was modified but $scope.mainForm.$dirty is true.