title: autocomplete is not working in angular?
body: <p>I want to do Autocomplete textbox for below data</p>
  
  <pre><code>Elements = [
      { id: 1, name: 'Hydrogen' },
      { id: 2, name: 'Helium' },
      { id: 3, name: 'Lithium' }
  
  
    ];
  </code></pre>
  
  <p>Html </p>
  
  <pre><code>&lt;mat-form-field class="example-full-width"&gt;
      &lt;input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="name"
       [matAutocomplete]="auto"  [errorStateMatcher]="matcher"&gt;
      &lt;mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" (selectionChange)="elementSelectionChange($event)"&gt;
        &lt;mat-option *ngFor="let Element of filteredOptions | async" [value]="Element.name"&gt;
          {{ Element.name}}
        &lt;/mat-option&gt;
      &lt;/mat-autocomplete&gt;
          &lt;mat-error *ngIf="myForm.hasError('required', 'name')"&gt;Please choose an name&lt;/mat-error&gt;
    &lt;/mat-form-field&gt;
  </code></pre>
  
  <p>component </p>
  
  <pre><code>export class DialogOverviewExampleDialog implements OnInit{
    Elements = [
      { id: 1, name: 'Hydrogen' },
      { id: 2, name: 'Helium' },
      { id: 3, name: 'Lithium' }
  
  
    ];
  
    matcher = new MyErrorStateMatcher();
    selectedElementSymbol: any;
    myForm: FormGroup;
    symbol;
    //name;
    name: FormControl = new FormControl();
    id;
    filteredOptions: Observable&lt;string[]&gt;;
    OnInit() {
      this.filteredOptions = this.name.valueChanges.pipe(
        startWith(''),
        map(val =&gt; this.filter(val))
      );
    }
  
    filter(val: any): any[] {
      return this.Elements.filter(Element =&gt; {
        return Element.name.toLowerCase().indexOf(val.toLowerCase()) &gt; -1;
      });
    }
    constructor(
      public dialogRef: MatDialogRef&lt;DialogOverviewExampleDialog&gt;,
      @Inject(MAT_DIALOG_DATA) public data: any,
      private formBuilder: FormBuilder) {
  
  
    }
  
  
  }
  </code></pre>
  
  <p>This is what I built so far. autocomplete is not working but .someone help me out to move forward</p>
  
  <p><a href="https://stackblitz.com/edit/angular-talrct-nsjuvp?file=app/table-basic-example.ts" rel="nofollow noreferrer">demo</a></p>