How to consistently get the root route of a lazy loaded module in Angular?

Discussão em 'Angular' iniciado por distante, Novembro 19, 2024.

  1. distante

    distante Guest

    I have a lazy load module, where I want to always trigger navigations relative to the module root.

    But I can not find a way to consistently find the root route of the module. That is, if my lazy Load module is configured in this way:

    {
    path: 'my/path/:id',
    loadChildren: () => import('@lib/my-module').then((m) => m.MyModule)


    I want to get something like my/path/20 so I an always control the module internal routes navigation relative to that path.

    Is this possible?

    Edit:

    I want to get my/path/20 even when I am on my/path/20/children-1/subchildren etc.

    Continue reading...

Compartilhe esta Página