You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ x] bug report => search github for a similar issue or PR before submitting
[ x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Expected/desired behavior
Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
What is the motivation / use case for changing the behavior?
If you have multiple modules that are triggered by aux routing always You have to create a fake component to operate the first route
Please tell us about your environment:
Angular version: 2.0.0-rc.X
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
I don't like to ask for an ETA but this issue is opened since august and it's really a problem to not be able to use auxiliary routes (within a lazy loaded module).
Is there any chance someone looks into it?
Reacted by Christophe Chevalier, Bart Superson, michalstepien, Kristian Tryggestad, Michal Klik, Thorsten Westheider, simplicitytrade, David Neukirchen, Julien, John Mistreanu and 45 more
It seems that lazy load and auxiliary routes are not widely used together.
We can see a lot of demos, separated but that's it. It's like no one uses it in a medium/large app 😮
These 2 are killer functionalities and no one seems to care about that issue ¯\_(ツ)_/¯
It's been nearly 8 months now.
I don't want to put pressure on anyone and I know it's open source. So instead of asking for ETA someone should try to implement it. But the router doesn't seem to be the better things to start digging for the first time in Angular code base. Especially for an issue with lazy loading and auxiliary routes.
That said, I hope someone can take a look into that and I'm sure the 21 people who put a 👍 on my comment would send kudos to our savior 👼 ❤️
PS : I also created a stackoverflow question (when I thought I was missing something instead of a bug) and it has +100 views.
Reacted by M'sieur Toph', Kevin Poon, Ruben Péricas-Moya, Jon Ruddell, jujyfruits, Andrew Hill, wodzu, Brian Campbell, Mariusz Pawelski, alberk8 and 25 more
I don't think it wouldn't be wide used if it worked.
I have the same problem, using [email protected] and I have to move forward, so I'm moving the component in question out to it's own separate module with no children paths, to be able to display it in the aux outlet, hopefully lazy-loaded. If that doesn't work I will even make it load normally.
When this is fixed I might change it back, if I have time
Update: It doesn't work with lazy loading because "Promise rejection: Invalid configuration of route 'liveAction': a componentless route cannot have a named outlet set".
It's almost as if they never even thought about using lazy loading and aux outlets together.
Huge chest bump to the Angular team but unfortunately I have to agree. I think the bar was set relatively low by targeting simple router-based apps with named outlets sprinkled in. Not only is lazy routing with named outlets not supported at this time but there is zero guidance on memory management (i.e. module unloading). Hopefully, this will be picked up for NG 5 or a patch. Angular team and community still rock in my world! 👍
Reacted by Artur Gevorgyan, monnef, Shane Swayney, Zach Mccain, Keegan Farley and Muhammad bin Yusrat
So far I have not found a working demo with lazy loading in a named router outlet e.x. <router-outlet name="view"></router-outlet>. I have made a plunkr to find a way to make it work without success. Any help would be much appreciated.
In the example above View1, View2 and View3 are lazy loaded in the default router-outlet. View3_1 and View3_2 are lazy loaded in the named router-outlet without success.
Patching the following changes directly into the compiled version of the router (from node_modules) completely fixed the issue for me 🙌 #25483
It's definitely not the right way of doing things but it feels so much simpler in that case than breaking some of my routes or have non empty routes for a workaround.
I hope that PR gets merged at some point.
Reacted by Alexander Trakhimenok, Roy Ling and Bitcollage
Hey guys, I've created a workaround for loading a lazy module's component through custom named outlets routing. Please have a look and hope this is useful.
I have a menu that opens modal windows, where each could contain quite a bit of code: my goal was to lazy load the modals on demand when needed, which I was able to get to work like so:
@jayoungers
I tried your solution but strangely, I get "No component factory found for ToolsViewStuffModalComponent" even though it's defined in entryComponents. Any idea?
@patachon - I don't know which modal library you're using, but generally in order for them to work properly you need to add the modal service as a provider in your secondary module (even though you likely have it imported or provided in a primary module as well)
@jayoungers You're right! I'm using Angular Material and imported MatDialogModule in the lazy-loaded module as well. Now I can see the dialog opens!
Thank you very much! 👍
angular-automatic-lock-bot commented on Oct 8, 2019
Activity
maxime1992 commentedon Jan 8, 2017
I don't like to ask for an ETA but this issue is opened since august and it's really a problem to not be able to use auxiliary routes (within a lazy loaded module).
Is there any chance someone looks into it?
victornoel commentedon Feb 20, 2017
Any news on that?
It seems #13807 has a complete plunkr to repro this issue :)
What can we do to help fix it? :)
SoulOnFire commentedon Apr 13, 2017
I have the same problem. Lazy modules don't work on aux routes
justkevsthlm commentedon Apr 13, 2017
Any updates on this problem?
maxime1992 commentedon Apr 13, 2017
It seems that lazy load and auxiliary routes are not widely used together.
We can see a lot of demos, separated but that's it. It's like no one uses it in a medium/large app 😮
These 2 are killer functionalities and no one seems to care about that issue ¯\_(ツ)_/¯
It's been nearly 8 months now.
I don't want to put pressure on anyone and I know it's open source. So instead of asking for ETA someone should try to implement it. But the router doesn't seem to be the better things to start digging for the first time in Angular code base. Especially for an issue with lazy loading and auxiliary routes.
That said, I hope someone can take a look into that and I'm sure the 21 people who put a 👍 on my comment would send kudos to our savior 👼 ❤️
PS : I also created a stackoverflow question (when I thought I was missing something instead of a bug) and it has +100 views.
vivanov-dp commentedon Apr 24, 2017
I don't think it wouldn't be wide used if it worked.
I have the same problem, using [email protected] and I have to move forward, so I'm moving the component in question out to it's own separate module with no children paths, to be able to display it in the aux outlet, hopefully lazy-loaded. If that doesn't work I will even make it load normally.
When this is fixed I might change it back, if I have time
Update: It doesn't work with lazy loading because "Promise rejection: Invalid configuration of route 'liveAction': a componentless route cannot have a named outlet set".
It's almost as if they never even thought about using lazy loading and aux outlets together.
chrisalexander55 commentedon Apr 24, 2017
Huge chest bump to the Angular team but unfortunately I have to agree. I think the bar was set relatively low by targeting simple router-based apps with named outlets sprinkled in. Not only is lazy routing with named outlets not supported at this time but there is zero guidance on memory management (i.e. module unloading). Hopefully, this will be picked up for NG 5 or a patch. Angular team and community still rock in my world! 👍
gtzinos commentedon May 11, 2017
Hello, any workaround to fix this issue ?
maxime1992 commentedon May 11, 2017
@gtzinos I tried to ask on Twitter this morning because I don't know what to do either after 8 months but no luck nor workaround yet
nekkon commentedon May 16, 2017
So far I have not found a working demo with lazy loading in a named router outlet e.x.
<router-outlet name="view"></router-outlet>. I have made a plunkr to find a way to make it work without success. Any help would be much appreciated.https://plnkr.co/edit/EW3PZUMC63euf2QYxtW5?p=preview
In the example above View1, View2 and View3 are lazy loaded in the default router-outlet. View3_1 and View3_2 are lazy loaded in the named router-outlet without success.
112 remaining items
maxime1992 commentedon May 23, 2019
Patching the following changes directly into the compiled version of the router (from node_modules) completely fixed the issue for me 🙌 #25483
It's definitely not the right way of doing things but it feels so much simpler in that case than breaking some of my routes or have non empty routes for a workaround.
I hope that PR gets merged at some point.
inthegarage commentedon Jun 20, 2019
I created a further stackblitz as a further playground for this issue. Please fork it as you wish.
https://stackblitz.com/edit/angular-router-auxilary-issue
It moves between panel b and c in panel a. Thanks to several posters here it has helped solve my panel in panel problem.
Jonathan002 commentedon Jul 20, 2019
Hey guys, I've created a workaround for loading a lazy module's component through custom named outlets routing. Please have a look and hope this is useful.
Repo: https://github.com/Jonathan002/route-master-example
JohnYoungers commentedon Jul 23, 2019
I have a menu that opens modal windows, where each could contain quite a bit of code: my goal was to lazy load the modals on demand when needed, which I was able to get to work like so:
app.component:
link:
added this to the root routes:
view-stuff-module
Editing to include modal close logic when the outlet is set to null
BenRacicot commentedon Jul 23, 2019
@jayoungers that is awesome! Could you setup a StackBlitz for us?
asvishnyakov commentedon Aug 7, 2019
Any updates on this?
Mark12870 commentedon Aug 30, 2019
I think I've got the same problem. The router-outlet doesn't work when I lazy-load its parent.
patachon commentedon Sep 7, 2019
@jayoungers
I tried your solution but strangely, I get "No component factory found for ToolsViewStuffModalComponent" even though it's defined in entryComponents. Any idea?
JohnYoungers commentedon Sep 7, 2019
@patachon - I don't know which modal library you're using, but generally in order for them to work properly you need to add the modal service as a provider in your secondary module (even though you likely have it imported or provided in a primary module as well)
patachon commentedon Sep 7, 2019
@jayoungers You're right! I'm using Angular Material and imported MatDialogModule in the lazy-loaded module as well. Now I can see the dialog opens!
Thank you very much! 👍
angular-automatic-lock-bot commentedon Oct 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.