由路由器出口创建组件时如何设置组件的输入绑定? [英] How to setup input bindings for a component when it's created by router-outlet?

查看:48
本文介绍了由路由器出口创建组件时如何设置组件的输入绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When a component is created by the router how can I setup property bindings?

推荐答案

不支持对路由器添加的组件使用绑定. 另请参见此讨论 https://github.com/angular/angular/issues/4452

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://angular.io/docs/ts/latest/cookbook/component-communication.html

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

这篇关于由路由器出口创建组件时如何设置组件的输入绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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