backbone-query-parameters
backbone-query-parameters copied to clipboard
Query Params loaded into key named "undefined" on params hash..
I have tried out this plugin,
- included backbone-query-parameters and the shim js files on a Backbone v1.1 project
- I have a router ( in Coffeescript:)
routes: {
"workspaces/:id/library": "index"
},
index: function(route, params) {
console.log(params);
}
I expect: that params should include the query params in the params object
I get: that the query params are on the params object, but under a key "undefined"
For example:
This strikes me as a poor namespace to place the query params under. However, maybe I'm setting this up wrong. Is this the expected behaviour of this plugin?
This looks like a bug. If the route is #foo?a=b then the params hash should look like {a: 'b'}. I'm not sure how this plugin functions under backbone 1.1 as I have not tested that so that could be the problem. Feel free to submit a pull request.