[英]Displaying component with @Input in another component's router-outlet
我想知道你们是否知道一种显示在路由器出口内采用@Input指令的组件的方法。
我有几个使用@Inputs的组件,我想在一个组件中动态显示这些组件。 我希望将这一组件容器设计为尽可能抽象,以便将来可以重用和扩展。
我正在努力实现类似
big-container.component具有
<router-outlet name='container1'></router-outlet>
在其中链接到container1.component,其中包含
<container1 [settings]=mySettings></container1>
我想使用[settings]将container1.component显示在big-container.component的路由器出口中。
谢谢!
如该POST所述,当前是不可能的。
这是Github上的链接问题
使用共享服务与路由器添加的组件进行通信。 有关详细信息,请参见https://angular.io/docs/ts/latest/cookbook/component-communication.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.