3
我想为我的表单中的单个输入字段使用setPristine方法。有一些方法可以为整个表单做到这一点,但我只想在表单中的一个输入字段中执行此操作。如何才能做到这一点?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">
可能的重复http://stackoverflow.com/questions/26837258/set-individual-input-element-to-ng-pristine –