title: Can I use custom Angular pipe outside of directive?
body: <p>I am currently formatting the response from the server inside of my component using Angular decimal pipe, like so:</p>
  
  <p>Component.ts</p>
  
  <pre><code>private formatCells(responseData) {
      for (let i = 0; i &lt; responseData.length; i++) {
          if  (responseData[i].value === 0) {
              responseData[i].value = this.decimalPipe.transform(responseData[i].value '1.2-2');
          } else {
              return responseData;
          }
      }
   }
  </code></pre>
  
  <p>I am doing it this way because I am using ag-grid and cannot use a pipe in the template.</p>
  
  <p>My goal is to move this logic inside of a custom pipe, and call that pipe on the responseData inside of my component.  Perhaps I do not need a custom pipe, as I am simply using decimalPipe, but I want to have the option to modify it later.  </p>
  
  <p>I have created a custom pipe and attempted to move the formatting functionality to the pipe, but I am not sure how to write the transform function and call it on responseData within the component.</p>
  
  <p>myPipe.ts</p>
  
  <pre><code>import { Pipe , PipeTransform } from '@angular/core';
  import { DecimalPipe } from '@angular/common';
  
  @Pipe({
      name: 'customDecimalFormat',
      pure: true
  })
  
  export class CustomDecimalFormatPipe extends DecimalTransform { 
      transform(value: any) {
         //...?
         return super.transform(value, "1.2-2"); 
      }
  }
  </code></pre>
  
  <p>How would I move the functionality from my Component.ts into the myPipe.ts?</p>