diff --git a/modules/angular2/src/core/compiler/view.js b/modules/angular2/src/core/compiler/view.js index 10d683ea07..b190c36254 100644 --- a/modules/angular2/src/core/compiler/view.js +++ b/modules/angular2/src/core/compiler/view.js @@ -308,7 +308,7 @@ export class ProtoView { } _instantiate(hostElementInjector: ElementInjector, eventManager: EventManager): View { - var rootElementClone = this.instantiateInPlace ? this.element : DOM.clone(this.element); + var rootElementClone = this.instantiateInPlace ? this.element : DOM.importIntoDoc(this.element); var elementsWithBindingsDynamic; if (this.isTemplateElement) { elementsWithBindingsDynamic = DOM.querySelectorAll(DOM.content(rootElementClone), NG_BINDING_CLASS_SELECTOR); diff --git a/modules/angular2/src/facade/dom.dart b/modules/angular2/src/facade/dom.dart index 79d0ec859c..25283272a1 100644 --- a/modules/angular2/src/facade/dom.dart +++ b/modules/angular2/src/facade/dom.dart @@ -187,6 +187,9 @@ class DOM { node.nodeType == Node.TEXT_NODE; static bool isElementNode(Node node) => node.nodeType == Node.ELEMENT_NODE; + static Node importIntoDoc(Node node) { + return document.importNode(node, true); + } } class CSSRuleWrapper { diff --git a/modules/angular2/src/facade/dom.es6 b/modules/angular2/src/facade/dom.es6 index f2175e218f..beebeffefa 100644 --- a/modules/angular2/src/facade/dom.es6 +++ b/modules/angular2/src/facade/dom.es6 @@ -219,6 +219,9 @@ export class DOM { static isElementNode(node:Node):boolean { return node.nodeType === Node.ELEMENT_NODE; } + static importIntoDoc(node:Node) { + return document.importNode(node, true); + } } export class CSSRuleWrapper {