I have an angular module loaded lazy using the new angular 8 method:
loadChildren: () => import('path').then(module => module.MyModuleClass)
This works fine, but now I require to configure the module. Normally this is easily achieved by implementing a static forRoot() method that returns a ModuleWithProviders object. But if I call it like this:
loadChildren: () => import('path').then(module => module.MyModuleClass.forRoot(myConfig))
... then I get a runtime error Error: Uncaught (in promise): Error: No NgModule metadata found for '[object Object]'.
Is there a way to use a module configuration for lazy loaded modules?