title: how to get autocomplete to make request on input change with angular-material2
body: <p>i'm playing with <a href="https://github.com/angular/material2/" rel="nofollow noreferrer">angular material</a> library. I'm trying to simple autocomplete that makes request(to fetch github repos which contains the string) after input changed.</p>
  
  <p>I did this code after looking at <a href="https://material.angular.io/components/autocomplete/examples" rel="nofollow noreferrer">autocomplete example</a> at demo section</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import {Component} from '@angular/core';
  import {Http} from '@angular/http'
  import {bootstrap} from '@angular/platform-browser-dynamic';
  import {FormControl} from '@angular/forms';
  import 'rxjs/add/operator/map'
  import 'rxjs/add/operator/startWith';
  
  @Component({
    selector: 'material-app',
    templateUrl: 'app.component.html'
  })
  export class AppComponent {
    stateCtrl: FormControl;
    private version: any;
    nm:string='';
    constructor(private http: Http) { 
      this.stateCtrl = new FormControl();
      this.reset();
    } 
    reset(){
      console.log('input changed...');
      this.repos = this.getRepos();
    }
    getRepos(){
      return this.http
        .get(`https://api.github.com/search/repositories?q=${this.nm}+language:javascript&amp;sort=stars&amp;order=desc&amp;per_page=10`)
        .map(res =&gt; res.json().items.map(i=&gt;i.name));
    }
  }
  </code></pre>
  
  <p>Here is my markup</p>
  
  <pre><code>&lt;md-input-container&gt;
     &lt;input mdInput [mdAutocomplete]="auto" [(ngModel)]="nm" (keyup)="reset()"&gt;
  &lt;/md-input-container&gt;
  
  &lt;md-autocomplete #auto="mdAutocomplete"&gt;
     &lt;md-option *ngFor="let option of repos | async" [value]="option"&gt;
        {{ option }}
     &lt;/md-option&gt;
  &lt;/md-autocomplete&gt; 
  </code></pre>
  
  <p>My problem here that i was forced to use "change" event to get autocomplete work each time criteria changed. </p>
  
  <p>I'm sure there is more accurate way, and i will be happy to know it...</p>
  
  <p>here is my <a href="http://plnkr.co/edit/otxoB0hQqN8Dv7NpTxm5?p=preview" rel="nofollow noreferrer">plunker</a></p>
  
  <p>Thanks </p>