diff --git a/modules/angular2/src/platform/dom/debug/debug_element_view_listener.ts b/modules/angular2/src/platform/dom/debug/debug_element_view_listener.ts index bee8c0bbf0..b7c0ce6610 100644 --- a/modules/angular2/src/platform/dom/debug/debug_element_view_listener.ts +++ b/modules/angular2/src/platform/dom/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 4949d93c0a..39abca7307 100644 --- a/modules/angular2/test/core/linker/integration_spec.ts +++ b/modules/angular2/test/core/linker/integration_spec.ts @@ -476,6 +476,19 @@ export function main() { }); })); + it('should use a comment while stamping out `