'read/get access to _loadedConfig routes (lazy load module's routes)

This code below displays one of the child routes (parent not shown here).

{ path: 'SampleChildRoute3' ,
            component: SampleComponent,
           // data: {appname : 'xxx'},
            children: [
              {path: '', loadChildren: () => import('./FeatureModule/FeatureModule.module').then(m=> m.FeatureModule), canActivate: [RoutesGuard]}
            ]
          },

I want to get access to FeatureModule's routes (up to 10 routes). I tried to use canActivate/canActivateChild guard services but _loadedConfig seems unreachable.

How can I read those routes, or do you have other opinion of how the routing architecture can be modified?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source