title: How to pass data from one child component to another child component in angular2?
body: <p>Suppose, i have a componentA and a componentB</p>
  
  <pre><code>@Component({
    selector: 'appA',
    templateUrl: './appA.html',
    styleUrls: ['./appA.css']
  })
  export class componentA{
    constructor(private route: Router) { } 
    moveFront() {
      this.route.navigateByUrl('componentB');
    }
  }
  
  @Component({
    selector: 'appB',
    templateUrl: './appB.html',
    styleUrls: ['./appB.css']
  })
  export class componentB{
    constructor(private route: Router) { } 
    moveBack() {
      this.route.navigateByUrl('componentA');
    }
  }
  </code></pre>
  
  <p>now when i call the moveFront() function, componentB gets called but i want to pass some data as well to the component, how can i do that?</p>
  
  <p>both my component is a child component, i want to transfer data to and from the one child component to another child component. how can i do it.</p>