我在一个页面中有两个兄弟组件需要调用第二个组件函数并传递onClick
第一个组件链接的一些值事件。
<my-container>
<sibling-component1></sibling-component1> // this has link to call function
<sibling-component2></sibling-component2> // this has function
</my-container>
我在一个页面中有两个兄弟组件需要调用第二个组件函数并传递onClick
第一个组件链接的一些值事件。
<my-container>
<sibling-component1></sibling-component1> // this has link to call function
<sibling-component2></sibling-component2> // this has function
</my-container>
喜欢解决方案(Angular 中协作指令之间的通信): http: //blog.carbonfive.com/2015/03/25/communication-between-collaborating-directives-in-angular/