I have written a model/view/collection using Backbone.js. My collection uses the fetch method to load the models from a remote server. The url required for this collection needs an id like: messages/{id}. But I have found no clean way to pass options to the Collection.
The backbone.js view accepts options by passing it on construction: view([options]), but the collection expects a list of models upon construction: collection([models]).
What is the "cleanest" way of passing parameters/options to this collection?
Shortened code:
var Messages = Backbone.Collection.extend({
model: Message,
url: 'http://url/messages/' + id
});