Reputation: 2865
When my form loads initially the $pristine property is always false. It was my understanding that as long as there's no user interaction with the form that the $pristine property will be true until the user changes the model via some kind of interaction. Is there anything else that I need to be aware that could set the $pristine property to false without the user manually changing the model? I'm trying to alert the user that there are unsaved changes before they close the form if it's not pristine.
Upvotes: 0
Views: 673
Reputation: 2865
The problem ended up being the use of the Select2 angularjs directive. There's a known bug that causes the form to be dirty on initialization. There's currently an open issue on github that covers this problem. Issue Here
Upvotes: 1