Skip to content

Commit 3f6d6f7

Browse files
authoredJan 26, 2017
Add function syntax to readme
1 parent 263bd36 commit 3f6d6f7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed
 

Diff for: ‎README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ var vm = new Vue({
5757
})
5858
```
5959

60+
If you need to access properties from the Vue instance, use the function syntax:
61+
62+
```js
63+
var vm = new Vue({
64+
el: '#demo',
65+
firebase: function () {
66+
return {
67+
anArray: db.ref('url/to/my/collection')
68+
}
69+
}
70+
})
71+
```
72+
6073
**About the cancelCallback**: This callback is actually an error handler that
6174
is called if the read/write doesn't succeed. You can of course also use it with
6275
`asObject: false` and apply it to arrays. The firebase doc states:
@@ -68,7 +81,7 @@ is called if the read/write doesn't succeed. You can of course also use it with
6881
6982
``` html
7083
<div id="demo">
71-
<pre>{{ anObject | json }}</pre>
84+
<pre>{{ anObject }}</pre>
7285
<ul>
7386
<li v-for="item in anArray">{{ item.text }}</li>
7487
</ul>

0 commit comments

Comments
 (0)