feat(renderer): use a comment instead of an element when stamping out template>` elements

Originally authored by @tbosch, this reverts the revert commit
e274ff8a69.

Closes #4805
This commit is contained in:
Jeff Cross
2015-11-20 13:46:37 -08:00
committed by Victor Savkin
parent 79399e1c51
commit 194dc7da78
3 changed files with 15 additions and 2 deletions
@@ -476,6 +476,19 @@ export function main() {
});
}));
it('should use a comment while stamping out `<template>` elements.',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
tcb.overrideView(MyComp, new ViewMetadata({template: '<template></template>'}))
.createAsync(MyComp)
.then((fixture) => {
var childNodesOfWrapper = DOM.childNodes(fixture.debugElement.nativeElement);
expect(childNodesOfWrapper.length).toBe(1);
expect(DOM.isCommentNode(childNodesOfWrapper[0])).toBe(true);
async.done();
});
}));
it('should support template directives via `template` attribute.',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
tcb.overrideView(