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

Error in AppCmp.getAppRoutes() ? #2

Open
vincentwinkel opened this issue Apr 19, 2016 · 2 comments
Open

Error in AppCmp.getAppRoutes() ? #2

vincentwinkel opened this issue Apr 19, 2016 · 2 comments

Comments

@vincentwinkel
Copy link

vincentwinkel commented Apr 19, 2016

Hi,
Thanks for your project.
I'm learning Angular2 so maybe I'm wrong, but I think there is an error here (AppCmp.getAppRoutes(), in app.ts line 91)
return { path: [/${route.as}], name: route.as };
should be
return { path: [${route.path}], name: route.as };

Moreover, can you show an example including 2 components sharing your routerConfigurator service in separate files ?
I try to do that, but when I add routes in my child component, I've an error (I can describe but it's not the goal of Issues :) ...)
Thanks !

@vincentwinkel
Copy link
Author

vincentwinkel commented Apr 22, 2016

Update: according to this doc: https://angular.io/docs/js/latest/api/router/RouteRegistry-class.html

It's seems possible to directly use this.registry.config(component, route) and this.registry.configFromComponent(component) instead of this.updateRouteConfig(component, ...) and this.getRoutes().

This solution allows this module to work with Angular Universal.

@mgechev
Copy link
Owner

mgechev commented Apr 22, 2016

@vincentwinkel worry for the late response. I'd appreciate a PR with the suggested change.

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