Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,20 @@ The resulting bound array stored in `vm.items` will be:
}
]
```

Therefore to delete or update an item: first you have to obtain a reference to the '.key' property or the item object. In your Vue instance you could add
``` js
//pass '.key' property from html
vm.deleteItem = function(key) {
var ref = db.ref('items/'+key)
ref.remove()
}
//pass in item object from html
vm.updateItem = function(item) {
var key = item['.key']
var ref = db.ref('items/'+key)
ref.set(item)
}
```
## Contributing

Clone the repo, then:
Expand Down