This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Old values in $watchGroup's callback is not correct. #16004
Labels
Comments
I think this works as egpected. Watch group old / new values are tracked individually, not as a collection. The first value didn't change when you changed the second value, it only changed from null to a, so it's correct that when the second value changed to b, the old value of the first is still null. |
@tobyee thanks for unearthing the issues and PR. I will create a new PR, as I think the one you linked doesn't improve the explanation sufficiently. |
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
May 22, 2017
This should help to prevent issues such as angular#8671, angular#12452, angular#16004. Closes angular#12643
3 tasks
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Jun 29, 2017
This should help to prevent issues such as angular#8671, angular#12452, angular#16004. Closes angular#12643
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Jun 29, 2017
This should help to prevent issues such as angular#8671, angular#12452, angular#16004. Closes angular#12643
See also #16024 for a discussion on the different behaviors. |
Narretz
added a commit
that referenced
this issue
Jun 29, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Uh oh!
There was an error while loading. Please reload this page.
I'm submitting a ...
Current behavior:
Old values in $watchGroup's parameters is not correct.
Expected / new behavior:
Correct values.
Minimal reproduction of the problem with instructions:
Steps:
log: [null,null], ovals:[null,null]
log: nvals:["a","a"], ovals:[null,null]
log: nvals:["a","b"], ovals:[null,"a"] (??? ovals expect to be ["a","a"] but not.)
plunker:
https://plnkr.co/edit/slDfDzwvGT6jrZtn42C9?p=preview
Angular version: 1.6.4
Browser: all
Anything else:
The text was updated successfully, but these errors were encountered: