single-spa-angular
single-spa-angular copied to clipboard
Routes with outlets inside of lazy module
I have a problem with routes with outlets inside a lazyloading module.
When i have childrens-routes with outles inside a lazyloading module single-spa can't interpret the route and stay in the parent route.
Demonstration
APP1Routing module:
const routes: Routes = [
{
path:'app1',
children:[
{path:'child',component:ChildComponent},
{path:'outlet',outlet:'example',component:OutletComponent},
{path:'lazy',
loadChildren:()=>import('./lazy/lazy.module').then(m => m.LazyModule)
},
]
},
{ path: '**', component: EmptyRouteComponent },
];
LazyModule routing:
const routes: Routes = [`
{
path:'',
component:LazyComponent,
children:[
{path:'child',component:ChildLazyComponent},
{path:'outlet',
outlet:'example',
component:OutletLazyComponent},
]
},
];
Console don't display errors or warnings.
I create one fork with the example (https://github.com/diogolPereira/coexisting-angular-microfrontends).
Expected Behaviour
Single-spa can interpret the angular routes with children's inside of lazy modules.
P.s: Original issue (https://github.com/joeldenning/coexisting-angular-microfrontends/issues/42)
Any news about this problem? I'm with the same
I don't spend much time maintaining single-spa-angular, and there aren't many other maintainers who help with it. I review pull requests and try to encourage others to help maintain single-spa-angular, but don't have time to go through all the issues.
I haven’t found any way to make this working, unfortunately. Outlets have been always problematic to deal with since it’s like an “addition” to the classic router behavior.