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
feat(router): generate absolute URI from router #294
Conversation
Note - this depends on changes in history (aurelia/history#7) and history-browser (aurelia/history-browser#22). |
@@ -186,7 +186,7 @@ export class Router { | |||
* @param params The route params to be used to populate the route pattern. | |||
* @returns {string} A string containing the generated URL fragment. | |||
*/ | |||
generate(name: string, params?: any): string { | |||
generate(name: string, params?: any, absolute?: boolean = false): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using an options object for the third parameter, in case we ever need to add more options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is definitely a good idea to use an option object, it'll make keeping BC changes easier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, it's more extensible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me as well. Let's go with the options object.
I'm removing core-js as a hard dependency and using our own aurelia-polyfills as a dev dependency when they are needed for tests. This will let the developer decide what they want in the end, with a favor towards our own which will be the minimum requirement...allowing it to be smaller and faster. Keep up the good work guys. Let's get this and the other two related improvements wrapped up and in as soon as we can. |
Adds an extra boolean argument to `router.generate` to specify whether or not to generate an absolute URI. Fixes aurelia#88.
810d221
to
6c46826
Compare
Adds an extra boolean argument to
router.generate
to specify whether or not to generate an absolute URI.Fixes #88.