title: Call function from one component to another component Angularjs 2
body: <p>I want to pass value from one component to another component.</p>
  
  <p>i.e., I need to pass value from Dashboard Component to Header Component</p>
  
  <p><strong>Here is my Dashboard Component</strong></p>
  
  <pre><code>import{Component}from '@angular/core';
  import { Header } from '../../layout/header.component';
  export class Dashboard{
  showAlert(id : any)
    {
        setItem(id);
    }
  }
  </code></pre>
  
  <p><strong>Here is my Header component</strong></p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  @Component({
    selector: 'header',
    templateUrl: './header.component.html',
  })
  export class Header{   
    public setItem(id : any)
    {
      console.log('Exported value'+id)
    }
  }
  </code></pre>
  
  <p>But it is always giving <strong>Cannot find setItem</strong></p>
  
  <p>What is the mistake i am doing and how can i fix this ? </p>
  
  <p><strong>Note :</strong>  I am doing this in Angularjs 2</p>