diff --git a/modules/angular2/src/core/debug/debug_element_view_listener.ts b/modules/angular2/src/core/debug/debug_element_view_listener.ts index 1e5ee4cc7a..a3646846d8 100644 --- a/modules/angular2/src/core/debug/debug_element_view_listener.ts +++ b/modules/angular2/src/core/debug/debug_element_view_listener.ts @@ -19,7 +19,7 @@ var _allViewsById = new Map(); var _nextId = 0; function _setElementId(element, indices: number[]) { - if (isPresent(element)) { + if (isPresent(element) && DOM.isElementNode(element)) { DOM.setData(element, NG_ID_PROPERTY, indices.join(NG_ID_SEPARATOR)); } } diff --git a/modules/angular2/src/core/render/dom/dom_renderer.ts b/modules/angular2/src/core/render/dom/dom_renderer.ts index 633a2cb2d9..8cc133fd09 100644 --- a/modules/angular2/src/core/render/dom/dom_renderer.ts +++ b/modules/angular2/src/core/render/dom/dom_renderer.ts @@ -194,9 +194,7 @@ export abstract class DomRenderer extends Renderer implements NodeFactory dehydrateView(viewRef: RenderViewRef) { resolveInternalDomView(viewRef).dehydrate(); } - createTemplateAnchor(attrNameAndValues: string[]): Node { - return this.createElement('script', attrNameAndValues); - } + createTemplateAnchor(attrNameAndValues: string[]): Node { return DOM.createComment('template'); } abstract createElement(name: string, attrNameAndValues: string[]): Node; abstract mergeElement(existing: Node, attrNameAndValues: string[]); abstract createShadowRoot(host: Node, templateId: string): Node; diff --git a/modules/angular2/test/core/linker/integration_spec.ts b/modules/angular2/test/core/linker/integration_spec.ts index f12b41d07f..422530598e 100644 --- a/modules/angular2/test/core/linker/integration_spec.ts +++ b/modules/angular2/test/core/linker/integration_spec.ts @@ -475,6 +475,19 @@ export function main() { }); })); + it('should use a comment while stamping out `