Closed nicolashery closed 10 years ago
Thats unfortunate. I'll get right on that! Thanks for creating this issue :)
Thanks!
I also bumped into the following "corner case", might be related...
Given this code:
var Handler = {
index: function(req) {
console.log(req);
}
};
Aviator.pushStateEnabled = false;
Aviator.setRoutes({
'/users': {
target: Handler,
'/': 'index'
},
'/cats/:id': {
target: Handler,
'/': 'index'
}
});
Aviator.dispatch();
Aviator.navigate('/users?foo=bar');
I get a Uncaught TypeError: Cannot read property 'indexOf' of undefined (aviator.js:898)
.
But if I comment out the pushStateEnabled = false
, it works as expected.
@nicolashery that seems unrelated, but definitely a bug with hash routing. Could you create another issue for that one? Thanks
Thanks for the quick turnaround @hojberg!
I tried it out with my first example of this issue. I get the expected queryParams: {foo: 'bar'}
, yay! However I notice that we now have namedParams: {id: '123?foo=bar'}
:-/
Is that a new bug, or could that be related to #57?
Sorry about this! :)
That could very much be #57.
Also don't apologize :) You're helping make Aviator more awesome! Thank you.
My pleasure :)
Btw, I just saw you had #59 up, so I went ahead and tested it, and it seems to fix both my previous comment and #57 :D Can't wait to see it merged and a new version tagged!
@nicolashery I tagged v0.4.1 with the 2 fixes :)
@hojberg Wonderful. Thanks again for quickly fixing this!
Given this code:
I get a Request object with
queryParams
empty andqueryString
null?If I comment out the line
Aviator.pushStateEnabled = false
though, I get the expected Request object, with the query string parsed properly.I was testing this in Chrome 34. Any ideas what's going on?
Thanks!