title: how to filter list in angular 2 using pipe?
body: <p>I am trying to filter my list using <strong>pipe</strong> I didn't get expect out .I don't knwo how to send <code>input</code> field value to pipe.</p>
  
  <p>here is my code</p>
  
  <p><a href="https://plnkr.co/edit/WFMo8Az7BSJaRJAVVxyE?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/WFMo8Az7BSJaRJAVVxyE?p=preview</a>
  when I type "a" it should only display "abc" in list</p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  
  
  @Pipe({ name: 'listpipe' })
  export class ListPipe implements PipeTransform {
    transform(items: any[], filter: string) {
       if (!items || !filter) {
              return items;
          }
    return items.filter(item =&gt; item.name.indexOf(filter) !== -1);
    }
  }
  </code></pre>