I'm trying to use setPristine method for a single input field in my form. There are ways to do this for the entire form but i want to do this only to one input field in my form.How can i do this?
I tried it this way
$scope.merchantDetails.customer_id.$setPristine = true;
But did not work.
This is the input field i want to set it to pristine state on some function.
<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">
Probably you can try this.
$scope.form.customer_id.$setPristine(false);
Have a look into this plunker.It might work for u.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With