How to correctly pass options to Backbone Collection
Good
var myCollection = new Asset.Collection(null, options);
Wrong
var myCollection = new Asset.Collection(options);
Wrong (this will initialize a collection of 1 model with default values)
var myCollection = new Asset.Collection({}, options);
Also when you override your initialize function:
initialize: function(models, options)
{
if (options)
{
(...)
}
},
Recent Comments