X Tutup
Skip to content

Async routes cause route data to be lost #6272

@hitmanmcc

Description

@hitmanmcc

Hello guys,

I'm using angular 2 beta.0 and I'm trying to change the routeconfigs so some of my components are loaded asynchronously.
Unfortunately, when I do so, the data I pass to the data parameter of the route gets lost. This is only happening for AsyncRoutes, I figured it might be the case that this is not supposed to be possible but the docs say otherwise.
I've set-up a plunkr where you can see this happen. There are 2 components to which you can navigate by clicking one of the 2 buttons.
The first one is for a synchronous route and it prints out the data I pass in.
The second one is for an asynchronous route and it does not print out anything because as you can see from the console output, the routeData object does not hold the data that I passed in the route configuration.
Example here: https://plnkr.co/edit/LYaQvPzpBmmI9ADn3poQ

Best regards,
André

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup