1

Any one explain in Angular 4 [Parent Component and both child component] its possible to pass data from child to child component

An example on each would be helpful in understanding both the cases. In what scenario can we use each case?

If parent to child component passing data i used @Input Decorator as same child to parent passing data i used @Output Decorator and Event Emitter.

Community
  • 1
  • 1
  • Have u tried reading this on google. There are plenty ref: https://ciphertrick.com/2017/07/24/parent-child-component-communication-angular/ – Shashank Vivek May 28 '18 at 10:44
  • You should pass data from child to parent and pass it again from parent to another child. – Arash May 28 '18 at 10:44
  • when the relations between two component is not parent-child I think is better using a service. You can use a service like it's showed in https://angular.io/guide/component-interaction#parent-and-children-communicate-via-a-service. Or using getter/setters https://stackoverflow.com/questions/48112868/call-function-from-one-component-to-another-to-update-the-button?noredirect=1&lq=1 – Eliseo May 28 '18 at 11:15

0 Answers0