I tried to follow this answer but its too confusing Angular 2 event catching between sibling components
I want to call a method in child component 1
Something like this:
Parent
@ViewChild(Child2) child2Component: Child2Component;
trackChanged(value:any) {
child2Component.trackChanged(value);
}
Child1
...
@Output() trackchanged= new EventEmitter();
...
playTrack() {
this.trackchanged.emit({value: this.track});
}
Child2
trackChanged(track){
console.log("YES!! " + track);
}