【发布时间】:2016-09-22 04:52:21
【问题描述】:
我正在尝试对表单中的单个输入字段使用 setPristine 方法。有办法对整个表单执行此操作,但我只想对表单中的一个输入字段执行此操作。我该怎么做?
我试过这样
$scope.merchantDetails.customer_id.$setPristine = true;
但是没有用。
这是我想在某些功能上将其设置为原始状态的输入字段。
<input class="form-control" id="id_customer_id" name="customer_id" placeholder="Auto-generated if empty" title="" type="text" maxlength="8" ng-keydown="check();" ng-model="customer.customerId">
【问题讨论】:
标签: angularjs