In angular 2/4, is there a way to inject modules and components discovered at runtime ?
I mean, NgModules can be loaded at runtime thanks to angular-cli/webpack but webpack needs to statically analyse all modules at compile time in order to package the application in different bundles. This works really great when the whole application is known in advance. But what if the modules are not know at compilation time ? What if they are discovered after the application is compiled and deployed.
I have an microservice (OSGi) application, where parts of the application are distributed in hotswapable independent modules and I'd like to package ng2 web interface along with my modules to make my application fully modular.
I had a look at How can I use/create dynamic template to compile dynamic Component with Angular 2.0?, but it seems Modules still need to be known in advance.
Any idea ?
Thanks