refactor(pipes): removed pipes from properties
BREAKING CHANGE: This PR remove an ability to use pipes in the properties config. Instead, inject the pipe registry.
This commit is contained in:
@ -141,11 +141,8 @@ export class KeyedAccess extends AST {
|
||||
visit(visitor: AstVisitor) { return visitor.visitKeyedAccess(this); }
|
||||
}
|
||||
|
||||
export class Pipe extends AST {
|
||||
constructor(public exp: AST, public name: string, public args: List<any>,
|
||||
public inBinding: boolean) {
|
||||
super();
|
||||
}
|
||||
export class BindingPipe extends AST {
|
||||
constructor(public exp: AST, public name: string, public args: List<any>) { super(); }
|
||||
|
||||
visit(visitor: AstVisitor) { return visitor.visitPipe(this); }
|
||||
}
|
||||
@ -336,7 +333,7 @@ export interface AstVisitor {
|
||||
visitChain(ast: Chain): any;
|
||||
visitConditional(ast: Conditional): any;
|
||||
visitIf(ast: If): any;
|
||||
visitPipe(ast: Pipe): any;
|
||||
visitPipe(ast: BindingPipe): any;
|
||||
visitFunctionCall(ast: FunctionCall): any;
|
||||
visitImplicitReceiver(ast: ImplicitReceiver): any;
|
||||
visitInterpolation(ast: Interpolation): any;
|
||||
@ -394,8 +391,8 @@ export class AstTransformer implements AstVisitor {
|
||||
ast.falseExp.visit(this));
|
||||
}
|
||||
|
||||
visitPipe(ast: Pipe) {
|
||||
return new Pipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args), ast.inBinding);
|
||||
visitPipe(ast: BindingPipe) {
|
||||
return new BindingPipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args));
|
||||
}
|
||||
|
||||
visitKeyedAccess(ast: KeyedAccess) {
|
||||
|
@ -34,7 +34,7 @@ import {
|
||||
PrefixNot,
|
||||
Conditional,
|
||||
If,
|
||||
Pipe,
|
||||
BindingPipe,
|
||||
Assignment,
|
||||
Chain,
|
||||
KeyedAccess,
|
||||
@ -73,15 +73,6 @@ export class Parser {
|
||||
return new ASTWithSource(ast, input, location);
|
||||
}
|
||||
|
||||
addPipes(bindingAst: ASTWithSource, pipes: List<string>): ASTWithSource {
|
||||
if (ListWrapper.isEmpty(pipes)) return bindingAst;
|
||||
|
||||
var res: AST = ListWrapper.reduce(
|
||||
pipes, (result, currentPipeName) => new Pipe(result, currentPipeName, [], false),
|
||||
bindingAst.ast);
|
||||
return new ASTWithSource(res, bindingAst.source, bindingAst.location);
|
||||
}
|
||||
|
||||
parseTemplateBindings(input: string, location: any): List<TemplateBinding> {
|
||||
var tokens = this._lexer.tokenize(input);
|
||||
return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings();
|
||||
@ -224,7 +215,7 @@ class _ParseAST {
|
||||
while (this.optionalCharacter($COLON)) {
|
||||
args.push(this.parsePipe());
|
||||
}
|
||||
result = new Pipe(result, name, args, true);
|
||||
result = new BindingPipe(result, name, args);
|
||||
} while (this.optionalOperator("|"));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user