title: prefill mat-autocomplete in angular 2 material 2
body: <p>I am not able to set the value of the <code>mat-autocomplete</code> when I am trying to edit a record I am using the autocomplete as a <code>FormControl</code> object in a <code>FormBuilder</code> object and to set values received from the server I am using <code>Formbuilder.setValue()</code> method, but this does not set autocomplete although it sends a request to the server as I am using the <code>valueChanges</code> method of Observables ... any help would be appreciated.</p>
  <p>Below is the Code I am using:</p>
  <p><strong>component.ts</strong></p>
  <pre><code>this.filteredData = this.addDetailsForm.get('product').valueChanges
      .debounceTime(400)
      .do(value =&gt;
      { 
          let exist = this.myContent.findIndex(t =&gt; t.text === value);
          if (exist &gt; -1) return;
          this._dataService.getSwiftProducts(value)
              .subscribe((res: any[]) =&gt; { this.myContent = res; });
      }).delay(500).map(() =&gt; this.myContent);
  </code></pre>
  <p><strong>component.html</strong></p>
  <pre><code>&lt;div class=&quot;row&quot;&gt;
      &lt;label class=&quot;col-lg-4 control-label&quot;&gt;Product: &lt;/label&gt;
      &lt;div class=&quot;col-lg-5&quot;&gt;
          &lt;input type=&quot;text&quot; class=&quot;form-control&quot; 
              (keyup.enter)=&quot;chooseFirstOption()&quot; 
              placeholder=&quot;Pick one&quot; aria-label=&quot;Number&quot; 
              matInput =&quot;product&quot; formControlName=&quot;product&quot; 
              [matAutocomplete]=&quot;auto&quot;&gt;
          &lt;p *ngIf=&quot;addDetailsForm.controls.product.errors&quot;&gt;
              This field is required!
          &lt;/p&gt;
          &lt;mat-autocomplete #auto=&quot;matAutocomplete&quot; 
              [displayWith]=&quot;displayFn&quot;&gt;
              &lt;mat-option *ngFor=&quot;let option of filteredData | async&quot; 
                  [value]=&quot;option&quot;&gt;
                  {{ option.description }}
              &lt;/mat-option&gt;
          &lt;/mat-autocomplete&gt;
      &lt;/div&gt;
  </code></pre>
  <p>Versions of Angular, Material, OS, TypeScript:</p>
  <pre><code>Angular : &quot;@angular/core&quot;: &quot;^5.0.0&quot;,
  
  Material : &quot;@angular/material&quot;: &quot;^5.0.0-rc0&quot;,
  
  OS: Windows 7
  
  Typescript : &quot;typescript&quot;: &quot;^2.6.2&quot;
  </code></pre>