title: Angular2 filtering array of objects based on an array of objects using pipe
body: <p>I'm struggling to get my head around how to filter an array of objects based on another array of objects using the angular pipe.  What i have so far is a pipe that filters based on a single argument.</p>
  
  <p>I have 2 arrays, array1 and array 2, which both contain complex objects. The filtered array (array1) should only contain objects where array1.value === array2.value</p>
  
  <p>My code so far:</p>
  
  <pre><code>import { Injectable, Pipe, PipeTransform } from '@angular/core';
  
  @Pipe({
    name: 'arrayFilter'
  })
  @Injectable()
  export class AttributeFilterPipe implements PipeTransform {
    transform(array: any[], filterFrom: any[]): any {
      return array.filter(item =&gt; item.value.indexOf(filterFrom[0].value) !== -1);
    }
  }
  </code></pre>