-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Labels
Milestone
Description
I'm trying to lazy load module Products
app.states.ts:
{
name: 'Products',
url: '/products',
lazyLoad: loadProductsModule
}
lazy.modules.ts:
export function loadProductsModule() {
return loadNgModule(function () {
return System.import('./views/products/products.module')
.then(result => {
return result.ProductsModule;
});
}, ExtraModuleInjector.injector);
}
0.chunk.js getting loaded successfully and System.import is getting resolved with object containing ProductsModule.
But next I'm getting an error: "No NgModule metadata found for '[object Object]"
With native router lazy load of same module works normally.
Could it be because of wrong scoped injector?
loadNgModule Gets the Injector (scoped properly for the destination state)
This one I'm getting from app.component from app module.
If I can't use this one, where should I take correct one? I couldn't find answer in docs.
Thank you.