I'm not quite sure if I fully understand your question.
Is there a template that allows you to use this type of "on-demand" components and their templates in ng2?
Well there is on-demand loading of modules using lazy loadable modules, see https://angular.io/docs/ts/latest/guide/ngmodule.html#!#lazy-load I highly recommend reading this guide, it is really useful .
but they should be able to exchange services and libraries.
The Corner Guide offers a common module and a basic module for this. In fact, I think this is really the best way to do this. Just scroll down the link above.
Each component can transmit its capabilities (in the form of the NG2 component), as well as the implementation of the protocol and the necessary GUI elements (HTML / CSS) through a packet sent over the same connection with websocket.
This is the part that Iβm not sure about, as if I donβt know if I understand correctly what you mean. You do not want to download the component through the connection with websocket? If so, why? If you mean only the connection for each component with the same website: I would recommend a service that will be part of the Core Module and therefore will be Singleton. Components can then access this service, and therefore they are always connected to the same website.
source share