title: How to read drop down list value from dialog box in angular 2
body: <p>I want to read value of drop down list from md dialog box. I unable to read it.
  My code is:</p>
  
  <p>right-panel-component.ts</p>
  
  <pre><code>import { Component, OnInit, ViewContainerRef,ViewChild } from 
   '@angular/core';
  import {MdDialog} from "@angular/material";
  import {MdDialogRef} from "@angular/material";
  import {ServersListDialogComponent} from "../servers-list-dialog/servers-
   list-dialog.component";
  import {DownTimeGraphComponent} from "../down-time-graph/down-
   time-graph.component";
  import any = jasmine.any;
  
  @Component({
   selector: 'app-rightpanel',
   templateUrl: './rightpanel.component.html',
   styleUrls: ['./rightpanel.component.css']
  })
  export class RightpanelComponent implements OnInit {
    receivedData:Array&lt;any&gt; = [];
    dialogRef: MdDialogRef&lt;any&gt;;
    componentData = null;
  
    constructor(public dialog: MdDialog) {}
  
    ngOnInit() {
    }
    transferDataSuccess($event) {this.openDialog($event.dragData.valueOf().id);  }
   openDialog(id) {
   if(id&gt;=1 &amp;&amp; id&lt;=8) {
    this.dialogRef = this.dialog.open(ServersListDialogComponent, {
      disableClose: false
    });
   } else {
    this.dialogRef = this.dialog.open(LogDialogComponent, {
      disableClose: false
    });
   }
  
   this.dialogRef.afterClosed().subscribe(result =&gt; {
  
    console.log('result: ' + result);
    console.log("after close dialog....");
    if(result == "yes") {
        if(graphName == "Down Time") {
          this.componentData = {
            component: DownTimeGraphComponent,
            inputs: {
              showNum: 9
            }
          };
        } 
    }
    this.dialogRef = null;
  });
  </code></pre>
  
  <p>}
  }</p>
  
  <p>server-list-dialog.component.ts</p>
  
  <pre><code>import { Component,OnInit} from '@angular/core';
  import {MdDialogRef} from "@angular/material";
  import {ServerItem} from '../server-item';
  import {GetServersListService} from '../get-servers-list.service';
  @Component({
   selector: 'app-servers-list-dialog',
   templateUrl: './servers-list-dialog.component.html',
   styleUrls: ['./servers-list-dialog.component.css']
   })
   export class ServersListDialogComponent implements OnInit {
    serverItems : ServerItem[];
   constructor(public dialogRef: 
   MdDialogRef&lt;ServersListDialogComponent&gt;,private 
   service:GetServersListService) { }
  
   ngOnInit() {
     this.service.getServerItemList().subscribe(lst =&gt;this.serverItems=lst);
  }
  
  }
  </code></pre>
  
  <p>server-list-dialog.component.html</p>
  
  <pre><code>&lt;p&gt;
    servers-list-dialog works!
  &lt;/p&gt;
  Select server: &lt;select name="serverid" id="server_list"&gt;
   &lt;option *ngFor="let serverItem of serverItems" value="{{serverItem.id}}"&gt;
   {{serverItem.name}}&lt;/option&gt;
  &lt;/select&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;button type="button" (click)="dialogRef.close('yes')"&gt;Yes&lt;/button&gt;
  &lt;button type="button" (click)="dialogRef.close('no')"&gt;No&lt;/button&gt;
  </code></pre>
  
  <p>I want to read drop down list value in right-panel.component.ts file
  I'm new in angular 2. Please give me solution how to read drop down list value from dialog box.</p>