The system I am working on consists of a number of distributed microservices with potentially multiple versions of each component active at the same time.
The Angular2 app I am attempting to build shall be able to interact with each of these components by means of websockets. Because it seems unfeasible to prepare this application for all future versions and features of each component, the respective protocol implementation and even new components, I would like to push this responsibility to the components itself.
Each component is able to communicate its capabilities (in the form of a NG2 component) as well as the protocol implementation and the necessary GUI elements (HTML/CSS) via a package sent over the very same websocket connection.
Is there a pattern that enables this kind of 'on-demand-loading' of components and their templates in ng2?
It looks like you can try to use router lazy loading and provide custom implementation of NgModuleFactoryLoader
which can load components via websocket.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With