angular 2 sequential pipes
<p>how do I use two pipes sequentially?</p>

<pre><code>&lt;div class="thread" *ngFor="thread of threadlist | bookmarkPipe | threadPipe"&gt;&lt;/div&gt;
</code></pre>

<p>In specific my threads have a bookmark:boolean property as well as tag properties (unit,task,subtask).
So what I want to achieve is that the first pipe filters all threads which are bookmarked, then apply the 2nd pipe (below)</p>

<pre><code>export class ThreadPipe implements PipeTransform{

  transform(array:Thread[], [unit,task,subtask]):any{

    //See all Threads
    if(unit == 0 &amp;&amp; task == 0 &amp;&amp; subtask == 0){
      return array
    }
    //See selected Units only
    if(unit != 0 &amp;&amp; task == 0 &amp;&amp; subtask == 0){
      return array.filter(thread =&gt; {
        return thread.unit === unit;
      });
    }
    //See selected Units and Tasks
    if (unit != 0 &amp;&amp; task != 0 &amp;&amp; subtask == 0){
      return array.filter(thread =&gt; {
        return thread.unit === unit &amp;&amp; thread.task === task;
      });
    }
    // See selected units, tasks, subtask
    if (unit != 0 &amp;&amp; task != 0 &amp;&amp; subtask != 0){
      return array.filter(thread =&gt; {
        return thread.unit === unit &amp;&amp; thread.task === task &amp;&amp; thread.subtask === subtask;
      });
    }
  }
}
</code></pre>