title: How to create and call a pipe from the component in Angular 2?
body: <p>I want to create a dynamic pipe which I am going to call from the component.</p>
  
  <pre><code>import {Component, Pipe, PipeTransform} from 'angular2/core';
  
  @Pipe({ name: 'filter', pure: false })
  export class filter implements PipeTransform {
    transform(value) {
      this.items1=value;
      this.ticket1 = [];
      if (this.items1.length &gt;0) {
        for (var i = 0; i &lt; this.items1.length; i++) {
          this.ticket1.push(this.items1[i])
        }
      }
    }
  }
  </code></pre>
  
  <p>I want to call this pipe from the component.</p>