Skip to content

Adding deletion and update info #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2016
Merged
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +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

Expand Down