mirror of https://github.com/abpframework/abp.git
5 changed files with 24 additions and 4 deletions
@ -0,0 +1,14 @@ |
|||||
|
import {Pipe, PipeTransform} from "@angular/core"; |
||||
|
|
||||
|
@Pipe({ |
||||
|
name: 'pipeFunction' |
||||
|
}) |
||||
|
export class PipeFunction implements PipeTransform { |
||||
|
public transform(value: any, handler: (value: any) => any, context?: any): any { |
||||
|
if (context) { |
||||
|
return handler.call(context, value); |
||||
|
} |
||||
|
|
||||
|
return handler(value); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue