Angular 2 Bootstrap多根组件 [英] Angular 2 bootstrap multi root component

查看:129
本文介绍了Angular 2 Bootstrap多根组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够将多个应用程序根组件引导到我的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆