Angular 2 Bootstrap多根组件 [英] Angular 2 bootstrap multi root component
问题描述
我希望能够将多个应用程序根组件引导到我的index.html页面中.最初可以在角度2 beta 0-15上实现,但是从beta 16开始,它不再起作用.请参考此代码 http://plnkr.co/edit/A7fyFUST9IdP1FriauXk?p=preview
I would like to be able to boot multiple app root component into my index.html page. This was initially possible on angular 2 beta 0 - 15, but starting in beta 16, it is not working anymore. Please refer to this code http://plnkr.co/edit/A7fyFUST9IdP1FriauXk?p=preview
please see plunker link above for the code
希望有人可以修改代码以能够在angular 2 beta 17上工作.
Hope somebody can modify the code to be able to work on angular 2 beta 17.
谢谢.
推荐答案
http://plnkr.co/edit/APFwcpOGsMlOMVdGCkCI
使用新版本变得容易得多
It got much easier with newer versions:
bootstrap(Comp1);
bootstrap(Comp2);
这也是一个有关如何在应用程序之间实现通信的更高级的示例: http://plnkr.co/edit/aZqdJe3OZ8K2odHioWkB
Also here is a more advanced example of how to implement communication between applications: http://plnkr.co/edit/aZqdJe3OZ8K2odHioWkB
这篇关于Angular 2 Bootstrap多根组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!