title: Filter multiple columns with one input via pipes | angular2
body: <p>I am trying to filter an array of objects with user input. I have completed this however only if I specify the property name to filter values on. How would I filter <em>every</em> properties values?</p>
  
  <p><strong>Pipe:</strong></p>
  
  <pre><code>@Pipe({ name: 'columns' })
  
  export class SearchPipe implements PipeTransform {
    transform(columns: any, filterText: any): any {
      if (filterText == null) return columns;
      return columns.filter(function(column) {
        return column.name.toLowerCase().indexOf(filterText.toLowerCase()) &gt; -1;
      })
    }
  }
  </code></pre>
  
  <p><strong>Template:</strong></p>
  
  <pre><code>&lt;input [(ngModel)]="filterText" type="text"&gt;
  
  &lt;tr *ngFor='let office of offices | columns: filterText'&gt;
    &lt;td&gt;&lt;input type="checkbox" checked class="i-checks" name="input[]"&gt;&lt;/td&gt;
    &lt;td&gt;{{ office.officeId }}&lt;/td&gt;
    &lt;td&gt;{{ office.name }}&lt;/td&gt;
    &lt;td&gt;{{ office.createdAt | date:'longDate'}}&lt;/td&gt;
    &lt;td&gt;{{ office.noOfPhones }}&lt;/td&gt;
    &lt;td&gt;{{ office.address }}&lt;/td&gt;
    &lt;td&gt;{{ office.region }}&lt;/td&gt;
    &lt;td&gt;{{ office.status }}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>