Angular 2 bootable multi-root components

I would like to be able to upload several components of the root application to my index.html page. This was initially possible on angular 2 beta 0-15, but since beta 16 it no longer works. See This Code http://plnkr.co/edit/A7fyFUST9IdP1FriauXk?p=preview

please see plunker link above for the code 

Hope someone can change the code to work on angular 2 beta 17.

Thanks in advance.

+5
source share
2 answers

http://plnkr.co/edit/APFwcpOGsMlOMVdGCkCI

It has become much easier with newer versions:

 bootstrap(Comp1); bootstrap(Comp2); 

A more detailed example of how to implement communication between applications is also given: http://plnkr.co/edit/aZqdJe3OZ8K2odHioWkB

+2
source

Just list all the components in bootstrap (and declarations )

 @NgModule({ imports: [ BrowserModule ], declarations: [ App, ModalComponent, CompComponent], providers: [SharedService], entryComponents: [CompComponent], bootstrap: [ App, ModalComponent ] }) export class AppModule{} 

See also. How to dynamically create bootable modals as Angular2 components? for a complete example.

+4
source

All Articles