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

feat(router): generate absolute URI from router #294

Merged
merged 1 commit into from May 9, 2016

Conversation

jwahyoung
Copy link
Contributor

Adds an extra boolean argument to router.generate to specify whether or not to generate an absolute URI.

Fixes #88.

@jwahyoung
Copy link
Contributor Author

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 {
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@EisenbergEffect
Copy link
Contributor

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.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 68.331% when pulling 6c46826 on jedd-ahyoung:router-get-origin into 13dcd60 on aurelia:master.

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

Successfully merging this pull request may close these issues.

None yet

5 participants