I am currently working on a project using Firebase along with AngularJS. The issue I am facing is deleting a randomly generated ID in the Realtime Database.
var todoFirebaseID;
// Insert Firebase
$scope.addFirebase = function() {
var objects = {
title: objectTitle.value,
content: objectContent.value
}
var list = $firebaseArray(storageRef);
list.$add(objects).then(function(storageRef) {
todoFirebaseID = storageRef.key;
$scope.addTodo();
});
}
// Delete Firebase
$scope.removeFirebase = function() {
var obj = $firebaseObject(storageRef);
obj.$remove().then(function() {
});
}
I have attempted to implement this functionality, but the issue is that it deletes all the data in Firebase instead of just the selected data. I am seeking guidance on how to resolve this issue. Can anyone provide a solution?