2

I know that in Angular you can develop an application with different modules for different application features, and have those modules lazy loaded only as required.

Is it possible though, to have an Angular 2 Framework application which loads other angular sub-applications as required?

So architecture would like like the following:

Shell Application, authorises user and determines which other apps are available to them

Admin Application - e.g. lets you manage user creation, etc

Client Application 1

Client Application 2

Client Application 3

The advantage of this kind of architecture would be that we could develop the sub-applications separately from each other, and run them as their own web site for development. It would also help to be able to only deploy the web sites that have changed.

What we would end up with would be like a portal which loads the components that the users have access to.

I have seen this question asked many times for Angular1, and the usual answer seems to be no

Edit - updating with some more information I am currently experimenting with using an iFrame to host child windows and Postmessage to communicate between them. This works reasonably well, but with the major downside that the url of the master website does not update as you browse through content in the child web site. I found this interesting article about different approaches to hosting micro front ends. The Canopy Single Spa framework mentioned in the article seems promising, but I believe requires more code examples before I could look at switching to it.

jazza1000
  • 4,099
  • 3
  • 44
  • 65
  • 1
    Possible duplicate of [Is it possible to nest Angular2 applications](https://stackoverflow.com/questions/38441867/is-it-possible-to-nest-angular2-applications) – Estus Flask Jun 30 '17 at 11:24
  • Technically, the answer for A1 is [with a hack](https://stackoverflow.com/a/32955398/3731501). Even if it's possible in A2+, it likely indicates design problem because the framework provides all means for nested modules to coexist within single app. – Estus Flask Jun 30 '17 at 11:27

1 Answers1

0

I think what you are trying to achieve here is exactly what npm has been used for. Separate and develop different module as npm dependencies and manage them using npm package management will give you the same benefits.

Angular framework itself work this way and its how all external libraries is being developed in the community

Julian
  • 609
  • 3
  • 7