Skip to content
This repository was archived by the owner on Aug 25, 2018. It is now read-only.

Commit 80cb2eb

Browse files
committed
Docs updates
1 parent 3ac3da7 commit 80cb2eb

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Play around with our [realtime Todo App demo](https://backbonefire.firebaseapp.c
1313
## Basic Usage
1414
Using BackboneFire collections and models is very similar to the regular ones in Backbone. To setup with BackboneFire use `Backbone.Firebase` rather than just `Backbone`.
1515

16+
**Note: A `Backbone.Firebase.Model` should not be used with a `Backbone.Firebase.Collection`. Use a regular
17+
`Backbone.Model` with a `Backbone.Firebase.Collection`.**
18+
1619
```javascript
1720
// This is a plain old Backbone Model
1821
var Todo = Backbone.Model.extend({
@@ -139,6 +142,17 @@ var TodoList = Backbone.Firebase.Collection.extend({
139142

140143
### url as a function
141144

145+
The `url` property can be set with a function. This function must return a Firebase ref or a url.
146+
147+
```javascript
148+
var TodoList = Backbone.Firebase.Collection.extend({
149+
url: function() {
150+
return new Firebase(...);
151+
}
152+
});
153+
```
154+
155+
142156
### initialize function
143157

144158
Any models added to the collection will be synchronized to the provided Firebase. Any other clients
@@ -213,8 +227,9 @@ var Todo = Backbone.Firebase.Model.extend({
213227
You may apply query methods as with `Backbone.Firebase.Collection`.
214228

215229
### urlRoot
216-
```javascript
230+
The `urlRoot` property can be used to dynamically set the Firebase reference from the model's id.
217231

232+
```javascript
218233
var Todo = Backbone.Firebase.Model.extend({
219234
urlRoot: 'https://<your-firebase>.firebaseio.com/todos'
220235
});

0 commit comments

Comments
 (0)