Load angular2 module into another application

I have a large angular2 application and I want to split it into multiple standalone applications so that each application can be loaded independently. So far so good.

I want, however, a "main application" that contains a navigation bar and can display components from "children's apps".

I tried to import into the main application a module from the child application and I was able to render the component successfully. Problems start to arise when the imported module has its own dependencies (like third party node modules) or services.

How can I achieve these goals:

  • there are several apps you can download yourself
  • You have a main application that can render components from another application, with one bootable file .

A good solution would be to convert the application to a library and then install it as an npm package. Is it possible? I mean automatically.

Thank.

+3


source to share





All Articles