0

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

Majid Parvin
  • 4,499
  • 5
  • 29
  • 47
Sandeep Soni
  • 85
  • 1
  • 7
  • Re-factor the model and its function from component1 into a service. Then have component2 call the function in that service. – georgeawg May 22 '17 at 08:29

1 Answers1

0

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

Sandeep Soni
  • 85
  • 1
  • 7