You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 25, 2018. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+16-1
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,9 @@ Play around with our [realtime Todo App demo](https://backbonefire.firebaseapp.c
13
13
## Basic Usage
14
14
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`.
15
15
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
+
16
19
```javascript
17
20
// This is a plain old Backbone Model
18
21
var Todo =Backbone.Model.extend({
@@ -139,6 +142,17 @@ var TodoList = Backbone.Firebase.Collection.extend({
139
142
140
143
### url as a function
141
144
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
+
returnnewFirebase(...);
151
+
}
152
+
});
153
+
```
154
+
155
+
142
156
### initialize function
143
157
144
158
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({
213
227
You may apply query methods as with `Backbone.Firebase.Collection`.
214
228
215
229
### urlRoot
216
-
```javascript
230
+
The `urlRoot` property can be used to dynamically set the Firebase reference from the model's id.
0 commit comments