title: Angular6 Getting error while trying to using DecimalPipe to a custom pipe
body: <p>I am trying to inject <code>DecimalPipe</code> to my custom pipe as described in this <a href="https://stackoverflow.com/a/35810607/5400597">answer</a>.</p>
  
  <p>here is the code:</p>
  
  <pre><code>@Pipe({name: 'irc'})
  export class IRCurrencyPipe implements PipeTransform {
  
    constructor(private decimalPipe: DecimalPipe) {}
  
    transform(value: string | number, type: string = 'rial') {
      value = Number(value);
     if (isNaN(value)) { throw new Error(`${value} is not a acceptable number`); }
      return this.decimalPipe.transform(value, '1.0-0') + ' ریال';
    }
  }
  </code></pre>
  
  <p>But I get <code>TypeError: Cannot read property 'transform' of undefined</code> error when running tests from this code.</p>
  
  <p>I also tried extending the <code>DecimalPipe</code> as suggested in <a href="https://stackoverflow.com/a/35808488/5400597">this answer</a>
  :</p>
  
  <pre><code>@Pipe({name: 'irc'})
  export class IRCurrencyPipe extends DecimalPipe implements PipeTransform {
  
  
    transform(value: string | number, type: string = 'rial') {
      value = Number(value);
      if (isNaN(value)) { throw new Error(`${value} is not a acceptable number`); }
      return super.transform(value, '1.0-0') + ' ریال';
    }
  }
  </code></pre>
  
  <p>But I get: <code>Error: InvalidPipeArgument: 'Cannot read property 'toLowerCase' of undefined' for pipe 'DecimalPipe'</code> in this case.
  Is there a working solution to using one of the built-in pipes in angular to a custom pipe?</p>