backbone.js - Is it possible to pass url parameter when creating an instance of Backbone Collection object? -


is possible pass url parameter when creating instance of collection object? create array of collections containing data 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 possible this, or doing terribly wrong? need create collection each page?

generally want create new collection each type of model


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -