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

update initialOptions to $watchCollection #50

Merged
merged 1 commit into from Jun 29, 2016

Conversation

swaheed2
Copy link
Contributor

Fix for issue: #49

Based on : http://stackoverflow.com/questions/15363259/watch-not-being-triggered-on-array-change

By default, $watch does not check for object equality, but just for reference. So, $watch('tasks', ...) will always simply return the same array reference, which isn't changing.

Angular v1.1.4 adds a $watchCollection() method to handle this case:

Shallow watches the properties of an object and fires whenever any of the properties change (for arrays this implies watching the array items, for object maps this implies watching the properties). If a change is detected the listener callback is fired.

@bianchimro bianchimro merged commit bcbeb88 into inmagik:master Jun 29, 2016
@swaheed2 swaheed2 deleted the patch-1 branch June 29, 2016 16:40
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

Successfully merging this pull request may close these issues.

None yet

2 participants