Adding in a note about passing in an object literal or a model to Collection.create. Thanks to MattJ for the recommendation.

This commit is contained in:
Samuel Clay
2011-04-25 13:01:03 -04:00
parent ee215be027
commit f44cfeeb36

View File

@@ -1377,6 +1377,12 @@ Accounts.fetch();
model from being created. In order for this to work, your should set the
<a href="#Collection-model">model</a> property of the collection.
</p>
<p>
You can pass in either an object literal or an existing model object. If you use
an existing model, it will have its collection set to this collection, thereby
removing it from any previous collection.
</p>
<pre>
var Library = Backbone.Collection.extend({