title: Angular 7 ERROR TypeError: Cannot read property 'pipe' of undefined
body: <p>Hi am very new to angular was trying to implement autocomplete using customfilters was getting this error related to pipe was not able find a solution from past 3 days.. can someone pls help me with this </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;mat-form-field class="col-12 col-sm-6"&gt;
      &lt;mat-label class="padding"&gt;Units&lt;/mat-label&gt;
      &lt;mat-select formControlName="unit" [(value)]="selected"  required style="padding-left: 10px;"&gt;
          &lt;mat-option *ngFor="let list of unitsList | async" [value]="list.codename"&gt;{{list.codevalue}}&lt;/mat-option&gt;
      &lt;/mat-select&gt;
      &lt;mat-error *ngIf="getvalue1.unit.errors"&gt;{{getunitErrorMessage()}}&lt;/mat-error&gt;
  &lt;/mat-form-field&gt;
  </code></pre>
  
  <p>my ts file:</p>
  
  <pre class="lang-js prettyprint-override"><code> ngOnInit() {
      //
      this.projectservice.getInventoryProjectsList().subscribe(
        data =&gt; {
         this.projectsList2 = data;
        }
      );
  
      // for inventory dropdown
      this.inventory.getInvDropdown().subscribe(
        data =&gt; {
  
          this.unitsList = data['units'];
          console.log(this.unitsList);
          // tslint:disable-next-line:no-string-literal
  
        }
      );
      this.formBuilderOnDemand();
      this.filter();
  
    }
    // // for filter
    filter() {
      this.filteredOptions = this.addInventoryForm.value.itemName.valueChanges
      .pipe(    // Error line 
        startWith(''),
        map(value =&gt; this._filter(value))
      );
    }
  
    // for search in item name
    private _filter(value: any): any[] {
      const filterValue = value.toLowerCase();
      return this.materialList.filter(list =&gt; list.toLowerCase().includes(filterValue));
    }
  
  </code></pre>