I have the following data array in my Firebase app. I want to delete Account3 using AngularFire’s $remove method but I can’t get it to work
[MY-FIREBASE-URL]
users
simplelogin:1
accounts
0
title: "Account1"
1
title: "Account2"
2
title: "Account3"
3
title: "Account4"
4
title: "Account5"
This is the code I’m using
var fbURL = [MY-FIREBASE-URL];
var ref = new Firebase(fbURL);
var authData = ref.getAuth();
if (authData) {
console.log("User " + authData.uid + " is logged in with " + authData.provider);
var accountPath = fbURL + "/users/" + authData.uid + "/accounts/" + account.title;
//alert(accountPath);
var accountRef = new Firebase(accountPath);
accountRef.remove();
} else {
console.log("User is logged out");
}
I see the console.log being written properly but nothing happens. What am I doing wrong?