feat(ivy): implement pipes (#22254)

PR Close #22254
This commit is contained in:
Marc Laval
2018-02-16 16:23:27 +01:00
committed by Kara Erickson
parent 5d4fa7f0c8
commit f64ee15487
9 changed files with 699 additions and 71 deletions

View File

@ -181,7 +181,10 @@ export const defineDirective = defineComponent as<T>(directiveDefinition: Direct
* @param pure Whether the pipe is pure.
*/
export function definePipe<T>(
{type, factory, pure}: {type: Type<T>, factory: () => PipeTransform, pure?: boolean}):
PipeDef<T> {
throw new Error('TODO: implement!');
{type, factory, pure}: {type: Type<T>, factory: () => T, pure?: boolean}): PipeDef<T> {
return <PipeDef<T>>{
n: factory,
pure: pure !== false,
onDestroy: type.prototype.ngOnDestroy || null
};
}