title: Cannot read property 'filter' of undefined
body: <p>I'm getting an error as follows:</p>
  
  <pre><code>Cannot read property 'filter' of undefined.
  </code></pre>
  
  <p>Component template:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input #input placeholder="Search" id="search"&gt;
  &lt;div class="item" *ngFor="let item of data | searchPipe: input.value"&gt;
    {{item}}
  &lt;/div&gt;
  </code></pre>
  
  <p>Pipe code:</p>
  
  <pre class="lang-ts prettyprint-override"><code>@Pipe({
    name: 'searchPipe',
    pure: false
  })
  export class SearchPipe implements PipeTransform {
    transform(data: any[], searchTerm: string): any[] {
      searchTerm = searchTerm.toUpperCase();
      return data.filter(item =&gt; {
        return item.toUpperCase().indexOf(searchTerm) !== -1 
      });
    }
  }
  </code></pre>
  
  <p>What causes the error?</p>