If I click on the delete button for item2, I want it to be removed from the list.
{
"items" : {
"category1" : {
"item" : {
"0" : {
"name" : "item1",
},
"1" : {
"name" : "item2",
},
"2" : {
"name" : "item3",
}
}
},
"category2" : {
"item" : {
"0" : {
"name" : "item1",
}
}
}
}
This is the code I have tried:
removeItem: function (item, category) {
db.ref('items').child('category1').child('item').child(item['.key']).remove()
},
Can anyone see what I am missing?