angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Calling $save does not trigger a $watch event

Open katowulf opened this issue 12 years ago • 6 comments

When we call $save on a local object, we push the current value to the server. If a change occurs, then a child_changed event will be triggered. However, because the data will already be set locally, no change will occur, and therefore neither $FirebaseArray nor $FirebaseObject will trigger a $watch event after. Consider sending notifications for these?

katowulf avatar Jul 31 '14 21:07 katowulf

I would like to still get the notification. That way I can handle updates in other parts of the app the same way regardless of where the update came from (local or remote).

joshbowdoin avatar Jul 31 '14 21:07 joshbowdoin

See also angular/angular.js#8325

katowulf avatar Aug 01 '14 21:08 katowulf

+1 for the notification. Until then, I'm using the promise returned by $save and calling the same function I specify for the $watch event. This seems a little repetitive, but I understand there is distinction between watching changes and watching when two locations are out of sync.

louiswilbrink avatar Aug 09 '14 14:08 louiswilbrink

So , this is fixed in 0.9.0 right?

spotlmnop avatar Dec 08 '14 03:12 spotlmnop

This has been fixed since version 0.8.1. See the last item in the 0.8.1 changelog.

jwngr avatar Dec 08 '14 05:12 jwngr

@jaymanned please post your own issue, rather than replying to one closed 2 years ago.

katowulf avatar May 09 '16 15:05 katowulf