From 366d1123d494467087fafaa45560867bab0969c3 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 4 Oct 2019 12:20:49 +0200 Subject: [PATCH] Destroy transclude scopes --- front/core/components/treeview/childs.html | 2 +- front/core/components/treeview/childs.js | 26 +--------------------- front/core/components/treeview/content.js | 10 +++++++-- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/front/core/components/treeview/childs.html b/front/core/components/treeview/childs.html index 7dd242380..5573dbbd9 100644 --- a/front/core/components/treeview/childs.html +++ b/front/core/components/treeview/childs.html @@ -3,7 +3,7 @@
  • { + this.treeview.$transclude(($clone, $scope) => { + this.$contentScope = $scope; $scope.item = this.item; - this.$element.append(tClone); + this.$element.append($clone); }); } + + $onDestroy() { + if (this.$contentScope) + this.$contentScope.$destroy(); + } } Controller.$inject = ['$element'];