single-spa-angular icon indicating copy to clipboard operation
single-spa-angular copied to clipboard

Routes with outlets inside of lazy module

Open diogolPereira opened this issue 4 years ago • 2 comments

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)

diogolPereira avatar Sep 14 '20 10:09 diogolPereira

Any news about this problem? I'm with the same

JohnnyHonorato avatar Sep 27 '21 12:09 JohnnyHonorato

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.

joeldenning avatar Sep 28 '21 16:09 joeldenning

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.

arturovt avatar Dec 29 '22 19:12 arturovt