I'm trying to implement lazy loading on an application for a client. The purpose is to have a portal and load modules in the main app (portal) with dynamic paths - received from the backend, for example.
I've found a nice example here: Stackoverflow example
The problem is that I'm going to have the portal and the other applications separate. It means that I need to build all the applications (to create the dist folder with the minified js files). My question is:
Given the code bellow, how do I import the module of the other application after it's built?
this.loader.load('./src/test.module#TestModule').then((factory: NgModuleFactory<any>) => {
console.log(factory);
});
I'm going to have an index.html file, css files, vendor js files, polyfills files and the app files (all built inside the dist folder). What should I specify here './src/test.module#TestModule'
? How do I load the built module?