This repository was archived by the owner on Jan 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
This repository was archived by the owner on Jan 12, 2019. It is now read-only.
$remove on a NormalizedCollection throws an Exception #90
Copy link
Copy link
Open
Description
I have a service with the following function:
this.getRequested = function (uid) {
var ref = new Firebase(FBURL);
var refSearch = ref.child('profiles/' + uid + '/friends/requested');
///*
var refSearch = new Firebase.util.NormalizedCollection(
[ref.child('profiles/' + uid + '/friends/requested'), "frId"],
[ref.child('users'), 'users', 'frId.username']
).select('frId.username', 'frId.status', 'users.img', 'users.uid').ref();
//*/
return $firebaseArray(refSearch);
}
After binding this to a $scope variable:
$scope.frRequested = Friends.getRequested(authData.uid);
Now if I remove a record as follows:
$scope.frRequested.$remove(friend);
I get the following WARNING:
FIREBASE WARNING: Exception was thrown by user callback. TypeError: Cannot read property 'ref' of null
at Object.i.update (https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js:9:22050)
at https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js:9:18061
at https://cdn.firebase.com/js/client/2.4.2/firebase.js:203:710
at gc (https://cdn.firebase.com/js/client/2.4.2/firebase.js:52:165)
at cc (https://cdn.firebase.com/js/client/2.4.2/firebase.js:30:216)
at dc (https://cdn.firebase.com/js/client/2.4.2/firebase.js:29:1259)
at Ji.h.Ob (https://cdn.firebase.com/js/client/2.4.2/firebase.js:223:440)
at X.set (https://cdn.firebase.com/js/client/2.4.2/firebase.js:259:335)
at X.remove (https://cdn.firebase.com/js/client/2.4.2/firebase.js:262:146)
at https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js:9:19948
firebase.js:52 Uncaught TypeError: Cannot read property 'ref' of null
I have tried a similar situation without using the NormalizedCollection, and everything works fine, i.e. when the service is as follow, it works without a problem:
this.getRequested = function (uid) {
var ref = new Firebase(FBURL);
var refSearch = ref.child('profiles/' + uid + '/friends/requested');
return $firebaseArray(refSearch);
}
Is this a bug?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels