angularjs – 有没有办法重置Angular中触及的$?

我正在尝试为我的表单实现“重置”按钮.我的一些文本字段使用$touch来确定是否显示错误.但是一旦设置了$touch标志,当我重置模型时,$touch不会被重置,因此我的错误消息仍然可见.
<div class="col-sm-4" ng-class="{'has-error' : donationForm.firstName.$invalid && donationForm.firstName.$touched}">
                <label for="firstName" class="control-label">First Name</label>
                <input type="text" id="firstName" name="firstName" class="form-control"
                       ng-model="editableDonation.person.firstName" ng-required="true" ng-maxlength="20" />
                <span class="help-block" ng-show="donationForm.firstName.$error.required && donationForm.firstName.$touched">
                    First Name is required.
                </span>
                <span class="help-block" ng-show="donationForm.firstName.$error.maxlength">
                    First Name is too long (20 max).
                </span>
            </div>

有没有办法做到这一点?

我的resetForm:

$scope.resetForm = function () {
        $scope.donationForm.$setPristine();
        $scope.model = '';

        $scope.donation = donationService.defaultDonation;
        $scope.editableDonation = angular.copy($scope.donation);
    };

http://plnkr.co/edit/Oa91ZkTatsddSA4oujQK

DeborahK89指出我可以使用:

$scope.donationForm $setUntouched().

相关文章

ANGULAR.JS:NG-SELECTANDNG-OPTIONSPS:其实看英文文档比看中...
AngularJS中使用Chart.js制折线图与饼图实例  Chart.js 是...
IE浏览器兼容性后续前言 继续尝试解决IE浏览器兼容性问题,...
Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:h...
在AngularJS应用中集成科大讯飞语音输入功能前言 根据项目...
Angular数据更新不及时问题探讨前言 在修复控制角标正确变...