fix(parser): parse pipes in template bindings
This commit is contained in:
parent
85abfa943d
commit
6b2650996c
@ -509,7 +509,7 @@ class _ParseAST {
|
|||||||
}
|
}
|
||||||
} else if (!this.peekKeywordVar()) {
|
} else if (!this.peekKeywordVar()) {
|
||||||
var start = this.inputIndex;
|
var start = this.inputIndex;
|
||||||
var ast = this.parseExpression();
|
var ast = this.parsePipe();
|
||||||
var source = this.input.substring(start, this.inputIndex);
|
var source = this.input.substring(start, this.inputIndex);
|
||||||
expression = new ASTWithSource(ast, source, this.location);
|
expression = new ASTWithSource(ast, source, this.location);
|
||||||
}
|
}
|
||||||
|
@ -525,6 +525,12 @@ export function main() {
|
|||||||
bindings = parseTemplateBindings("directive: var item in expr; var a = b", 'location');
|
bindings = parseTemplateBindings("directive: var item in expr; var a = b", 'location');
|
||||||
expect(keyValues(bindings)).toEqual(['directive', '#item=\$implicit', 'in=expr in location', '#a=b']);
|
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', () => {
|
describe('parseInterpolation', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user