title: send same event to two different functions of corresponding button click in Angular 2 Typescript
body: <p>I have a service that fetches JSON data that I subscribe to in two different variables in my component. I have two drop down lists and each one makes use of one variable to filter data.
  I then send this data to another set of buttons Array or List. Each drop-down should operate independently.</p>
  
  <pre><code>&lt;div class="TSO-ddl" &gt;
      &lt;md-select [(ngModel)]="selectedISO" (ngModelChange)="onSelect($event,selectedISO)" placeholder="TSO"  &gt;
          &lt;md-option  value="Charge Only"  &gt; Charge Only &lt;/md-option&gt;
          &lt;md-option  value="PJM"  &gt;PJM  &lt;/md-option&gt;
          &lt;md-option  value="Not in ISO Market"  &gt; Not in ISO Market &lt;/md-option&gt;
          &lt;md-option  value="UCSD"  &gt; UCSD &lt;/md-option&gt;
          &lt;md-option  value="Any" &gt; Any &lt;/md-option&gt;
      &lt;/md-select&gt;
  &lt;/div&gt;
  
  &lt;div class="Status-ddl"&gt;
      &lt;md-select [(ngModel)]="selectedStatus" (ngModelChange)="onSelect($event,selectedStatus)" placeholder="Status" &gt;
          &lt;md-option  value="NC"  &gt;  Not Connected &lt;/md-option&gt;
          &lt;md-option  value="GI"  &gt; Active  &lt;/md-option&gt;
          &lt;md-option  value="SLP"  &gt;  Sleeping &lt;/md-option&gt;
          &lt;md-option  value="IA"  &gt; Inactive  &lt;/md-option&gt;
          &lt;md-option  value="Any"  &gt; Any  &lt;/md-option&gt;
      &lt;/md-select&gt;
  &lt;/div&gt;
  
  &lt;md-list-item class="ui-primary-selector"&gt; 
     &lt;div&gt;  
         &lt;label  class="labeltag"&gt; View &lt;/label&gt;
         &lt;button md-button  *ngFor="let view of viewButtons "  [ngClass]="{'selected-item' :view === selectedView}" type="button" (click)="onClickView(selecctedISO,view); onClickView2(selectedStatus,view)"&gt;
          {{view.Name}} &lt;/button&gt;
    &lt;/div&gt;
  &lt;/md-list-item&gt;
  </code></pre>
  
  <p>TS file</p>
  
  <pre><code>    constructor(private vehicleService: VehicleService) {
          this.isoArray = [];
          this.statusArray = [];
          this.isoToShow = this.isoArray;
          this.statusToShow = this.statusArray;
      }
  
      ngOnInit() {
          this.vehicleService.getIVS()
              .subscribe(isoArray =&gt; {
                  this.isoArray = isoArray;
                  this.isoToDisplay();
  
              },
              error =&gt; this.errorMessage = &lt;any&gt;error);
  
          this.vehicleService.getIVS()
              .subscribe(statusArray =&gt; {
                  this.statusArray = statusArray;
                  this.statusDisplay();
  
              },
              error =&gt; this.errorMessage = &lt;any&gt;error);
      }
  
  
      viewButtons: IButton[] = [
          { Id: 1, Name: 'Array' },
          { Id: 2, Name: 'List' }
      ];
  
      onSelect(val, button: IButton) {
  
          if (val = "Charge Only" || "PJM" || "USCD" || "Not in ISO Market" || "Any") {
              this.selectedISO = val;
              this.onClickView(val, button)
          }
          else if (val = "NC" || "GI" || "SLP" || "IA") {
              this.selectedStatus = val;
              this.onClickView2(val, button);
          }
          console.log(val);
      }
  
      onClickView2(val, button: IButton) {
  
          this.selectedView = button;
          if (button.Id == 1) {
              val = this.selectedStatus;
              console.log(val);
              if (val === "Any")
              { this.statusToShow = this.statusArray; }
              else
              { this.statusToShow = this.statusArray.filter(resource =&gt; resource.primary_status === val); }
  
  
              //displays an array
  
          }
          else if (button.Id == 2) {
              val = this.selectedStatus;
  
              if (val === "Any")
              { this.statusToShow = this.statusArray; }
              else
              { this.statusToShow = this.statusArray.filter(resource =&gt; resource.primary_status === val); }
          }
  
          //displays a list
      }
  
      onClickView(val, button: IButton) {
  
          this.selectedView = button;
          if (button.Id == 1) {
              val = this.selectedStatus;
              console.log(val);
              if (val === "Any")
              { this.isoToShow = this.isoArray; }
              else
              { this.isoToShow = this.isoArray.filter(resource =&gt; resource.iso_id === val); }
              //displays an array
  
          }
          else if (button.Id == 2) {
              val = this.selectedStatus;
  
              if (val === "Any")
              { this.isoToShow = this.isoArray; }
              else
              { this.isoToShow = this.isoArray.filter(resource =&gt; resource.iso_id === val); }
          }
          //displays a list
      }
  </code></pre>
  
  <p>My problem is that the event from the drop-downs gets sent to only one of the functions while the other gets a null value.
  How can I send data to both functions from the onSelect() whenever there is a corresponding value.</p>