Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Params loaded into key named "undefined" on params hash.. #84

Open
joshuaballoch opened this issue Jan 6, 2014 · 1 comment
Open

Comments

@joshuaballoch
Copy link

I have tried out this plugin,

  1. included backbone-query-parameters and the shim js files on a Backbone v1.1 project
  2. 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:

screen shot 2014-01-06 at 2 36 19 pm

screen shot 2014-01-06 at 2 36 14 pm

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?

@jhudson8
Copy link
Owner

jhudson8 commented Jan 7, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants