I am using angular.js version 1.1.5 which has $setPristine
on the form controller. But this method does not seem to clear any errors associated with fields. The code below works for me, but I am not sure whether this is the right way to clear errors. Any advice?
In my controller:
if ($scope.myform) {
$scope.myform.$setPristine();
delete $scope.myform.myfield.$error.myvalidator;
}