angular 2如何绑定两个组件行为
我有两个相等的分量angular 2如何绑定两个组件行为,angular,typescript,Angular,Typescript,我有两个相等的分量 <component><component> <component><component> 我需要的是,如果其中一个改变了,另一个也改变了,例如,如果我有一个函数,当我点击元素时,写“hello”,如果我在其中一个元素中这样做,它将反映在两个组件中,我如何实现这一点 提前谢谢 <component #c1 (click)="c2.title = 'hello'"><component> <
<component><component>
<component><component>
我需要的是,如果其中一个改变了,另一个也改变了,例如,如果我有一个函数,当我点击元素时,写“hello”,如果我在其中一个元素中这样做,它将反映在两个组件中,我如何实现这一点
提前谢谢
<component #c1 (click)="c2.title = 'hello'"><component>
<component #c2 (click)="c1.title = 'hello'"><component>
有关其他方法,请参见