Is it possible to pass url parameter when creating an instance of Collection object? I would like to create an array of collections containing data for all pages.
var Collection = Backbone.Collection.extend({
model: MainModel,
initialize: function (models,options) {
var self = this;
self.fetch();
}
});
var Collections = {
news : new Collection({url : "../data/news"}),
projects : new Collection({url : "../data/projects"}),
home : new Collection({url : "../data/home"})
};
Is that possible like this, or I am doing something terribly wrong? Do I need to create a collection for each page?