Ответ 1
существует, чтобы очистить данные и отключить прослушиватели событий. Если вам нужно отвязать $firebaseArray()
или $firebaseObject()
, вы может использовать $destroy()
, но я думаю, было бы лучше использовать разрешенную функцию unbind.
Этот фрагмент кода был взят из angularfire-seed
var unbind;
// create a 3-way binding with the user profile object in Firebase
var profile = $firebaseObject(fbutil.ref('users', user.uid));
profile.$bindTo($scope, 'profile').then(function(ub) { unbind = ub; });
// expose logout function to scope
$scope.logout = function() {
if( unbind ) { unbind(); }
profile.$destroy();
...
};