I am using AngularJS and FireBase in my application. I bound an object to be in sync with FireBase:
$scope.winnerPromise = angularFire(travelBidsFirebaseRef
The disassociate function is passed to you when the promise is resolved. I'd use it as follows:
var ref = travelBidsFirebaseRef.child("user/" + $scope.auction.winnerUserId);
var promise = angularFire(ref, $scope, "winner", {});
promise.then(function(disassociate) {
// Do some work...
disassociate(); // Don't synchronize $scope.winner anymore.
});
Hope this helps!
I am using angularfire and for me it worked the $destroy
method.
https://github.com/firebase/angularfire/blob/master/docs/reference.md#destroy-1