-
Notifications
You must be signed in to change notification settings - Fork 156
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
parsing query params after optional rest path #130
Comments
|
Same for me, i'm in a similar case strugling with the parser to route: Path: Expression: Expected: Result: how can we contribute to fixing it with a right aproach? |
@olavorn your expression should really be another option is to use the rest segment ( |
Hi @millermedeiros!! as I stated, I understand the workarounds, but, as I'm using Ben Alman's jQuery BBQ (which is also awesome) to manage the hash variables. the &id part is not about the url itself, but is a separate variable. see: "Route/App#container1=/Account/Dashboard&id=1" is built as $.bbq.getState('container1') //returns "/Account/Dashboard" Agreed that '/Account/Dashboard&id=1' is not valid as url, but that is not the case, as you can see. They are diferent variables within hash section and there is no reason the parser should not understand that as so. |
I'm hit with the same problem. The solution I found is to change the match for the OR (and RR) token from greedy to non-greedy. Do you understand what I mean or should I submit a pull request? |
Also, in the first case, if the optional "path" parameter doesn't have a rest segment and is omitted, the query param can't be used without using a preceding slash (/). Doesn't Work: one/two?id=1&test=1 |
Use RegExp instead of pattern for app route, because Crossroads.js extracts the query string as part of the rest segment. This is because it does not support having both segments as optional. See: millermedeiros/crossroads.js#130
Use RegExp instead of pattern for app route, because Crossroads.js extracts the query string as part of the rest segment. This is because it does not support having both segments as optional. See: millermedeiros/crossroads.js#130
Use RegExp instead of pattern for app route, because Crossroads.js extracts the query string as part of the rest segment. This is because it does not support having both segments as optional. See: millermedeiros/crossroads.js#130
Use RegExp instead of pattern for app route, because Crossroads.js extracts the query string as part of the rest segment. This is because it does not support having both segments as optional. See: millermedeiros/crossroads.js#130
Use RegExp instead of pattern for app route, because Crossroads.js extracts the query string as part of the rest segment. This is because it does not support having both segments as optional. See: millermedeiros/crossroads.js#130
Use RegExp instead of pattern for app route, because Crossroads.js extracts the query string as part of the rest segment. This is because it does not support having both segments as optional. See: millermedeiros/crossroads.js#130
* Use RegExp to handle optional rest and query segments Use RegExp instead of pattern for app route, because Crossroads.js extracts the query string as part of the rest segment. This is because it does not support having both segments as optional. See: millermedeiros/crossroads.js#130 * Expose utility function parseQueryString * Parse route query string into an object * Reload app only if there is no rest segment * Restrict app name capturing group to expected pattern * Use variables to check custom routing condition
* Use RegExp to handle optional rest and query segments Use RegExp instead of pattern for app route, because Crossroads.js extracts the query string as part of the rest segment. This is because it does not support having both segments as optional. See: millermedeiros/crossroads.js#130 * Expose utility function parseQueryString * Parse route query string into an object * Reload app only if there is no rest segment * Restrict app name capturing group to expected pattern * Use variables to check custom routing condition
I have following query
and router based on string
I expect two values
but I receive
I found that compiled pattern looks like this (example)
but it should probably looks like this (examle)
The generated pattern for
:path*:
covers also query which starts with question mark. So this character should probably be excluded.Am I right?
The text was updated successfully, but these errors were encountered: