I need to do some stuff within the route definition, when the lazyloaded module is loaded. The route has a resolver UserDataResolverService, how can I access the resolved data within the route definition?
{
path: 'path-a',
resolve: { userData: UserDataResolverService},
loadChildren: () =>
import('./pages/my.module').then((m) => {
// access resolved data here: userdata.details
return m.MyModule;
}),
}
loadChildrenshould simply return a module. Why would you even want to add logic there?activateevent. Don't add complex logic into the route module loader.PreloadAllModules. Your code will result in a horrific UX in that case. (and obviously I strongly suggest you usePreloadAllModules...)