From d8568f5c581136ad275803946f439e09f013f596 Mon Sep 17 00:00:00 2001 From: Jeff Cross Date: Fri, 20 Nov 2015 13:46:37 -0800 Subject: [PATCH] feat(renderer): use a comment instead of an element when stamping out template>` elements Originally authored by @tbosch, this reverts the revert commit e274ff8a69ca8e59237b6d0e01a8e2e9292f2142. Closes #4805 --- .../browser/debug/debug_element_view_listener.ts | 2 +- .../angular2/test/core/linker/integration_spec.ts | 13 +++++++++++++ .../e2e_test/naive_infinite_scroll_spec.ts | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/angular2/src/platform/browser/debug/debug_element_view_listener.ts b/modules/angular2/src/platform/browser/debug/debug_element_view_listener.ts index bcf5670883908..043c0541475af 100644 --- a/modules/angular2/src/platform/browser/debug/debug_element_view_listener.ts +++ b/modules/angular2/src/platform/browser/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/test/core/linker/integration_spec.ts b/modules/angular2/test/core/linker/integration_spec.ts index a809bf951663d..02ce988ac9638 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 `