-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Description
I'm submitting a
[x] bug report
[ ] feature request
[ ] support request
The router displays the component immediately, regardless of the result of routerOnActivate.
This is most apparent when that method returns a promise.
I believe the cause is in RouterOutlet.activate which calls the DynamicComponentLoader.loadNextToLocation before the result of routerOnActivate is known.
The loader displays the component immediately.
See this plunker (a cut down version of the router demo in the docs) for a demonstration of the experience.
You may wonder why I wrapped CrisisDetailComponent in CrisisDetailShellComponent. I wanted to be true to the letter of the documentation which says
If routerOnActivate returns a promise, the route change will wait until the promise settles to instantiate and activate child components. [emphasis mine]
I think that wrapping should be unnecessary. It shouldn't display the component itself let alone its children. But in case that mattered, I made sure that the routerOnActivate governed the parent of the child that it should not display.