feat(change_detection): change binding syntax to explicitly specify pipes

This commit is contained in:
vsavkin
2015-02-19 17:47:25 -08:00
parent 69e02ee76f
commit 58ba700b14
20 changed files with 236 additions and 101 deletions
+10
View File
@@ -14,6 +14,7 @@ import {
PrefixNot,
Conditional,
Formatter,
Pipe,
Assignment,
Chain,
KeyedAccess,
@@ -52,6 +53,15 @@ export class Parser {
return new ASTWithSource(ast, input, location);
}
addPipes(bindingAst:ASTWithSource, pipes:List<String>):ASTWithSource {
if (ListWrapper.isEmpty(pipes)) return bindingAst;
var res = ListWrapper.reduce(pipes,
(result, currentPipeName) => new Pipe(result, currentPipeName),
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();