This repository was archived by the owner on May 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 203
Initial state of a ui-date control is dirty (ng-dirty) causing the form state to be dirty as well #158
Comments
I have tracked it down to the following code if (controller) {
controller.$render();
// Update the model with the value from the datepicker after parsed
setVal(true); // *** this causes control to become dirty ***
} |
Thanks for tracking that down, I will not have much time to update this so PRs are welcome. |
@alexanderchan I understand and will see if I can get to it next week |
+1 If I add Too simple? |
can you guys fix it ? |
You can just add after lines:
additional code to set form $dirty field to false
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When you add ui-date directive to an input control the initial state of the control is dirty causing the form to be dirty as well. The control should only be dirty when the user changes the value.
https://plnkr.co/edit/QaM7f8uOn4mm11JiYAwr
The text was updated successfully, but these errors were encountered: