This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngForm stays $dirty after control.$setPristine() #13715
Closed
Description
Hi there. Frustrating problem. in an ngForm, if in my controller I set one of the form's controls to $dirty (via control.$setDirty()), then in the controller set the same control to $pristine, the form remains $dirty.
- on state load, form is $pristine
- via another event, call controller function that does control.$setDirty() - form is now $dirty
- via another event, call controller function that does control.$setPristine() - form is still $dirty
I'm pretty sure this shouldn't happen, and is getting kludgy to fix. I'm using Angular 1.4.8.
Plunkr:
https://plnkr.co/edit/6noEtj6vbMkqxiKK6Yp7?p=preview
Thanks