a')) + .toEqual([ + [HtmlTokenType.TAG_OPEN_START, '
'],
+ [HtmlTokenType.TEXT, 'a'],
+ [HtmlTokenType.EOF, ''],
+ ]);
+
+ expect(tokenizeAndHumanizeParts('< a>'))
+ .toEqual([[HtmlTokenType.TEXT, '< a>'], [HtmlTokenType.EOF]]);
+ });
+
+ // TODO(vicb): make the lexer aware of Angular expressions
+ // see https://github.com/angular/angular/issues/5679
+ it('should parse valid start tag in interpolation', () => {
+ expect(tokenizeAndHumanizeParts('{{ a d }}'))
+ .toEqual([
+ [HtmlTokenType.TEXT, '{{ a '],
+ [HtmlTokenType.TAG_OPEN_START, null, 'b'],
+ [HtmlTokenType.ATTR_NAME, null, '&&'],
+ [HtmlTokenType.ATTR_NAME, null, 'c'],
+ [HtmlTokenType.TAG_OPEN_END],
+ [HtmlTokenType.TEXT, ' d }}'],
+ [HtmlTokenType.EOF]
+ ]);
+ });
+
});
describe('raw text', () => {
diff --git a/modules/angular2/test/compiler/html_parser_spec.ts b/modules/angular2/test/compiler/html_parser_spec.ts
index eb709c6113aa..5094eb3a8da4 100644
--- a/modules/angular2/test/compiler/html_parser_spec.ts
+++ b/modules/angular2/test/compiler/html_parser_spec.ts
@@ -141,6 +141,14 @@ export function main() {
]);
});
+ it('should not add the requiredParent when the parent is a template', () => {
+ expect(humanizeDom(parser.parse('', 'TestComp')))
+ .toEqual([
+ [HtmlElementAst, 'template', 0],
+ [HtmlElementAst, 'tr', 1],
+ ]);
+ });
+
it('should support explicit mamespace', () => {
expect(humanizeDom(parser.parse('
\n
\n\n