title: How to get drop down text in mat-select using angular 6
body: <p>Here is is my code HTML:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;mat-list-item class="primary-imenu-item" role="listitem"&gt;
      &lt;mat-select class="form-control" multiple formControlName="statusCode" (selectionChange)="getSelectedOptionText($event)"&gt;
          &lt;mat-option *ngFor="let list of statusList" [value]="list.id" checkboxPosition="before"&gt;
              {{list.code}}
          &lt;/mat-option&gt;
      &lt;/mat-select&gt;
  &lt;/mat-list-item&gt;
  </code></pre>
  
  <p>TS Code:</p>
  
  <pre class="lang-js prettyprint-override"><code>getSelectedOptionText(event: MatSelectChange) {
      let selectedData = {
          code: (event.source.selected as MatOption).viewValue,
          value: event.source.value
      };
  
      console.log(selectedData);
  }
  </code></pre>
  
  <p>In that 'selectedData' I am getting  the code value is undefined. I need to get code value from dropdown.</p>