Reputation: 5958
I need to "reset" the state (validations too) of a form every time i'm going to revalidate it. I know $setPristine() function but this doesn't reset the validation state of the controls (i want to remove ng-invalid css-class).
Is there a function to do this to all the controls in a form at once?
I'm in Angular 1.3.8
Upvotes: 2
Views: 283
Reputation: 2802
use $setValidity
to change the validity state and notify the form
https://docs.angularjs.org/api/ng/type/ngModel.NgModelController
Upvotes: 0