From 454a63e1f17b71055ce1bf31d9d3ccc8e4f27ee9 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 30 Oct 2015 16:18:01 -0700 Subject: [PATCH] [Representation] Destroy scopes before adding Destroy representation scope before adding elements back into the DOM; avoids having a momentary activation of watches and listeners on those scopes before they are replaced with newly compiled content for new scopes. --- platform/representation/src/TemplateLinker.js | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/representation/src/TemplateLinker.js b/platform/representation/src/TemplateLinker.js index dc19943ed8..82cc1eb153 100644 --- a/platform/representation/src/TemplateLinker.js +++ b/platform/representation/src/TemplateLinker.js @@ -132,6 +132,7 @@ define( function changeTemplate(templateUrl) { if (templateUrl) { + destroyScope(); addElement(); self.load(templateUrl).then(function (template) { // Avoid race conditions