[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:
@@ -132,6 +132,7 @@ define(
|
|||||||
|
|
||||||
function changeTemplate(templateUrl) {
|
function changeTemplate(templateUrl) {
|
||||||
if (templateUrl) {
|
if (templateUrl) {
|
||||||
|
destroyScope();
|
||||||
addElement();
|
addElement();
|
||||||
self.load(templateUrl).then(function (template) {
|
self.load(templateUrl).then(function (template) {
|
||||||
// Avoid race conditions
|
// Avoid race conditions
|
||||||
|
|||||||
Reference in New Issue
Block a user