fix(parser): parse pipes in template bindings

This commit is contained in:
vsavkin 2015-02-23 13:12:49 -08:00
parent 85abfa943d
commit 6b2650996c
2 changed files with 7 additions and 1 deletions

View File

@ -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);
}

View File

@ -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', () => {