You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
I have a directive with a custom formatter (a custom datetime control) that alters the value in the model in some way for display purposes (datetime object formatted using a mask, something like: dd/mm/yyyy hh:mm, you will of course loose precision)
so you have: $modelValue with the original datetime (precision up to milliseconds) and $viewValue with the modified value (precision up to minutes).
if you place any directive/attribute that internally invoke ctrl.$validate() (like the ngRequired) this will have the side effect of parsing the value again and ASSIGN it to the model, OVERWRITING the original value even if the user didn't typed or interacted with anything.
Personally I do think this kind of side-effects are dangerous, something that does a validation should not change my model value.