[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.
This commit is contained in:
Victor Woeltjen 2015-10-30 16:18:01 -07:00
parent b487fa4438
commit 454a63e1f1

View File

@ -132,6 +132,7 @@ define(
function changeTemplate(templateUrl) {
if (templateUrl) {
destroyScope();
addElement();
self.load(templateUrl).then(function (template) {
// Avoid race conditions