Search code examples
angularjsangular-componentssiblings

how to call method of another sibling component - angular 1.5


I have two sibling components in one page need to call second component function and pass some value onClick event of first component link.

<my-container>
    <sibling-component1></sibling-component1> // this has link to call function
    <sibling-component2></sibling-component2> // this has function
</my-container>

code link : https://codepen.io/sandeep821/pen/aWQXZx?editors=1111


Solution

  • Fond the Solution (Communication between collaborating directives in Angular) : http://blog.carbonfive.com/2015/03/25/communication-between-collaborating-directives-in-angular/