简体   繁体   English

由路由器出口创建组件时如何设置组件的输入绑定?

[英]How to setup input bindings for a component when it's created by router-outlet?

当路由器创建组件时,如何设置属性绑定?

It is not supported to use bindings for components added by the router. 不支持对路由器添加的组件使用绑定。 See also this discussion https://github.com/angular/angular/issues/4452 另请参阅此讨论https://github.com/angular/angular/issues/4452

Use a shared service to communicate with components added by the router. 使用共享服务与路由器添加的组件进行通信。 For details see https://angular.io/docs/ts/latest/cookbook/component-communication.html 有关详细信息,请参见https://angular.io/docs/ts/latest/cookbook/component-communication.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM