mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user