2

I have a lazy loaded module which includes named router-outlet (auxiliary routes). I'm not able to target content into this router. The path match and I can see it in the url but the content doesn't appear.

Here is a code example: Stackblitz

==== UPDATE

The code is fixed.

Usage:

  1. click on the "LOAD SUBMODULE" link
  2. submodule loads
  3. click on any lines above of "SUBMOD loaded" title.
DA.PROXI
  • 23
  • 3

1 Answers1

1

When you are using a router outlet inside a component the child routes needs be declared as children for the parent route.

This is how your submod routes should look like

{
  path: '',
  component: SubmodComponent,
  children: [
    { path: 'toloadin', outlet: 'suboutlet', component: ToLoadinComponent },
  ],
}
Mr. Stash
  • 2,940
  • 3
  • 10
  • 24