如何将依赖项(如服务)注入angular2管道?
import {Pipe, PipeTransform} from 'angular2/core';
import {MyService} from './service';
//How i am injecting MyService to the pipe?
@Pipe({name: 'exponentialStrength'})
export class ExponentialStrengthPipe implements PipeTransform {
transform(value:number, args:string[]) : any {
return Math.pow(value, parseInt(args[0] || '1', 10));
}
}