Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AngularJS change: Add ability to give listeners the old collection in $watchCollection #53

Closed
teropa opened this issue Mar 26, 2014 · 1 comment

Comments

@teropa
Copy link
Owner

teropa commented Mar 26, 2014

Applying angular/angular.js#6736

@teropa teropa changed the title Add ability to give listeners the old collection in $watchCollection listeners AngularJS change: Add ability to give listeners the old collection in $watchCollection listeners Mar 29, 2014
@teropa
Copy link
Owner Author

teropa commented Mar 29, 2014

Note to readers: The issue discussed in the book, where $watchCollection listeners get the new value twice in their listener function, and never get the old value, has been fixed in Angular.

The corresponding changes for the book are:

  1. Change the test case introduced on page 74 ("works like a normal watch for non-collections") to not make any assertions about the old value. We'll deal with it later.
  2. Change the test case introduced on page 95 ("does not consider any object with a length property an array") to the way its done on the newest version of the book. Previously it relied on oldValue and it'll break after this change.
  3. Implement the old collection handling as described on pages 96-99.

@teropa teropa closed this as completed Mar 29, 2014
@teropa teropa changed the title AngularJS change: Add ability to give listeners the old collection in $watchCollection listeners AngularJS change: Add ability to give listeners the old collection in $watchCollection Mar 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant