Skip to content

Commit fd34968

Browse files
committed
Fix README code style and comments
Closes #43
1 parent 97318f1 commit fd34968

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,20 @@ The resulting bound array stored in `vm.items` will be:
154154
}
155155
]
156156
```
157-
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
158-
``` js
159-
//pass '.key' property from html
160-
vm.deleteItem = function(key) {
161-
var ref = db.ref('items/'+key)
162-
ref.remove()
163-
}
164-
//pass in item object from html
165-
vm.updateItem = function(item) {
166-
var key = item['.key']
167-
var ref = db.ref('items/'+key)
168-
ref.set(item)
157+
158+
To delete or update an item you can use the `.key` property of a given object:
159+
160+
``` js
161+
// Vue instance methods
162+
deleteItem: function (item) {
163+
this.$firebaseRefs.items.child(item['.key']).remove()
164+
},
165+
updateItem: function (item) {
166+
this.$firebaseRefs.items.child(item['.key']).set(item)
169167
}
170-
```
168+
```
169+
170+
You can check the full example at [examples/todo-app](examples/todo-app/index.html).
171171

172172
## Contributing
173173

0 commit comments

Comments
 (0)