title: How to pass selected value to other component angular 2
body: <p>I am trying to pass value selected from one of the options. I used ngModel to save the value but I can't figure out how to pass it to other component.</p>
  
  <p>Component1.ts</p>
  
  <pre><code>  &lt;select [(ngModel)]="selectedElement.id"&gt;
      &lt;option *ngFor="let type of types" [ngValue]="type.id"&gt; {{type.Name}}&lt;/option&gt;
    &lt;/select&gt;
    @Input() selectedElement:any= {id:2,Name:'abdfsdgsc'};
    types:any[]=[
      {id:1,Name:'abc'},
      {id:2,Name:'abdfsdgsc'}
  ];
  </code></pre>
  
  <p>component2.ts</p>
  
  <pre><code>constructor() {
    if(this.selectedElement.id==1){
       themeConfig.config();
    }else {
       themeConfig.theme();
    }
  }
  </code></pre>