Skip to content

Commit f228619

Browse files
author
vsternbach
committed
added decorators for service and pipes, modified component decorator
1 parent 5bdc6f6 commit f228619

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/decorators.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ export interface PipeTransform {
3636
transform(value: any, ...args: any[]): any;
3737
}
3838

39+
interface PipeTransformStatic {
40+
new(...args: any[]): PipeTransform;
41+
}
42+
3943
export function Pipe(options: {name: string}, moduleOrName: string | ng.IModule = 'app.pipes') {
40-
return (Pipe: any) => {
41-
var instance = new Pipe();
44+
return (Pipe: PipeTransformStatic) => {
45+
let instance = new Pipe();
4246
module(moduleOrName).filter(options.name, () => instance.transform);
4347
}
4448
}

0 commit comments

Comments
 (0)