What is the purpose of specifying a model in the Backbone collection
Backbone.Collection.extend({
url: '/rest/product',
model: Model
});
Basically, you say that every model within a collection is an instance Model. It is also useful for this.
col.add({
prop1: "foo",
...
});
And he will call new Model({prop1: "foo", ... })for you and add it to the collection.
.model
source
share