diff options
| author | Igor Minar | 2014-03-17 15:48:09 -0700 |
|---|---|---|
| committer | Igor Minar | 2014-03-18 12:01:42 -0700 |
| commit | 3dd9572754c7bafec30dd625f5c611346959c969 (patch) | |
| tree | 31ed324303ffef13c31435e06d439635b54da79d /test/ng/rafSpec.js | |
| parent | 922cb7e42f1ff6c3f39342b96be472048ad9cb25 (diff) | |
| download | angular.js-3dd9572754c7bafec30dd625f5c611346959c969.tar.bz2 | |
fix(Scope): $watchCollection should call listener with oldValue
Originally we destroyed the oldValue by incrementaly copying over portions of the newValue
into the oldValue during dirty-checking, this resulted in oldValue to be equal to newValue
by the time we called the watchCollection listener.
The fix creates a copy of the newValue each time a change is detected and then uses that
copy *the next time* a change is detected.
To make `$watchCollection` behave the same way as `$watch`, during the first iteration
the listener is called with newValue and oldValue being identical.
Since many of the corner-cases are already covered by existing tests, I refactored the
test logging to include oldValue and made the tests more readable.
Closes #2621
Closes #5661
Closes #5688
Closes #6736
Diffstat (limited to 'test/ng/rafSpec.js')
0 files changed, 0 insertions, 0 deletions
