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.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
max or min causes input type=date to fire $viewChangeListeners during every validation #10125
Angular 1.3.3
Problem is that in general, objects are compared using !==, which does not work as expected for Date objects. Culprit is this function
function writeToModelIfNeeded() {
if (ctrl.$modelValue !== prevModelValue) {
ctrl.$$writeModelToScope();
}
}
for this to work, it would have to be same instance of the Date. For date input types, this comparsion should be smarter and compare Date.getTime() insted.
This also causes to fire changed event during initialization when max or min are used (since they call $validate).
Activity
mdvorak commentedon Nov 19, 2014
This may be related to #9913, but I did not test it.
Narretz commentedon Nov 19, 2014
It is indeed the same issue. It will be fixed in 1.3.4, you can see a preview here: http://plnkr.co/edit/YpCpE1NQM83sXo8vY18d?p=preview
mdvorak commentedon Nov 20, 2014
Ah, thats great news, next time I'll test against master as well :) Thanks