Following the documentation, I did:
var collection = new Backbone.Collection.extend({
model: ItemModel,
url: '/Items'
})
collection.fetch({ data: { page: 1} });
the url turned out to be: http://localhost:1273/Items?[object%20Object]
I was expecting something like http://localhost:1273/Items?page=1
So how do I pass params in the fetch method?
changing:
to:
So with out over doing it, this is called with your
{data: {page:1}}object asoptionsSo it sends the ‘data’ to jQuery.ajax which will do its best to append whatever
params.datais to the URL.