Open samlevin opened 9 years ago
Can you post how you are loading data. Form dirty normally doesn't get set unless you are triggering user events.
Basically making a call to an HTTP service, which returns an object (in a predetermined format), and then I bind that object to scope in a controller. The UI template uses this controller, and I'm using 'ng-model' (on the $scope object properties) to display the object properties in the UI
EDIT: After I load the controller/template with the form, the log states 'all forms are clean'. However, when I try to click another object (which loads a new form), I then get a log message stating 'a form is dirty', even after I've made 0 clicks on the UI (aside from opening up a new form).
It seems like $pristine() is called after the directive loads, but before the HTTP call has finished.
Make sure your form is in $pristine state while it is loading data. Perhaps a specific control your are using is setting your form as $dirty.
It may help to pinpoint the exact source of error if you put a breakpoint on $setDirty() to see who is calling that.
Any time I add values to a form (that are loaded through HTTP), this library always thinks my form is dirty. Any easy workaround? I want the dirty check to start taking place only after a form is initialized.
Thanks a ton for your quick guidance.