diff --git a/modules/angular2/src/change_detection/parser/parser.js b/modules/angular2/src/change_detection/parser/parser.js index 66d2f8423c..09ade4da04 100644 --- a/modules/angular2/src/change_detection/parser/parser.js +++ b/modules/angular2/src/change_detection/parser/parser.js @@ -509,7 +509,7 @@ class _ParseAST { } } else if (!this.peekKeywordVar()) { var start = this.inputIndex; - var ast = this.parseExpression(); + var ast = this.parsePipe(); var source = this.input.substring(start, this.inputIndex); expression = new ASTWithSource(ast, source, this.location); } diff --git a/modules/angular2/test/change_detection/parser/parser_spec.js b/modules/angular2/test/change_detection/parser/parser_spec.js index 19e43ae7b9..0ace2d67e4 100644 --- a/modules/angular2/test/change_detection/parser/parser_spec.js +++ b/modules/angular2/test/change_detection/parser/parser_spec.js @@ -525,6 +525,12 @@ export function main() { bindings = parseTemplateBindings("directive: var item in expr; var a = b", 'location'); expect(keyValues(bindings)).toEqual(['directive', '#item=\$implicit', 'in=expr in location', '#a=b']); }); + + it('should parse pipes', () => { + var bindings = parseTemplateBindings('key value|pipe'); + var ast = bindings[0].expression.ast + expect(ast).toBeAnInstanceOf(Pipe); + }); }); describe('parseInterpolation', () => {