fix(HtmlParser): do not add required parents to template root elements

fixes #5967
This commit is contained in:
Victor Berchet
2016-06-15 09:45:19 -07:00
parent 9ba400d7d5
commit e484c62a8d
2 changed files with 8 additions and 2 deletions

View File

@ -36,7 +36,6 @@ export function main() {
});
});
describe('elements', () => {
it('should parse root level elements', () => {
expect(humanizeDom(parser.parse('<div></div>', 'TestComp'))).toEqual([
@ -158,6 +157,13 @@ export function main() {
]);
});
// https://github.com/angular/angular/issues/5967
it('should not add the requiredParent to a template root element', () => {
expect(humanizeDom(parser.parse('<tr></tr>', 'TestComp'))).toEqual([
[HtmlElementAst, 'tr', 0],
]);
});
it('should support explicit mamespace', () => {
expect(humanizeDom(parser.parse('<myns:div></myns:div>', 'TestComp'))).toEqual([
[HtmlElementAst, ':myns:div', 0]