Reputation: 1600
Need to delete entry trainName
I tried the below code which didnt work for me.
var usersRef = new Firebase('https://hosurcabapp.firebaseio.com').child('user');delee
var clientInfo = $firebase(usersRef);
$scope.clientInfo = clientInfo.$asObject();
$scope.deleteClient = function(key) {
clientInfo.$remove(key);
};
Kindly help since am new to Firebase
Upvotes: 2
Views: 724
Reputation: 598728
You can not set a null
value in Firebase, since Firebase treats null
as an instruction to delete the node. To quote the docs:
Passing
null
toset()
will remove the data at the specified location.
Since your application most likely uses the null
to signal some specific condition, you should substitute another value to signal that condition:
ref.child('trainName').set('<unnamed>');
If you want to delete a node, you can do:
usersRef.child(key).remove();
See also the documentation for the Firebase delete function.
Upvotes: 4