diff --git a/client/core/src/components/tooltip/tooltip.js b/client/core/src/components/tooltip/tooltip.js index 101ce357a..6da52513c 100644 --- a/client/core/src/components/tooltip/tooltip.js +++ b/client/core/src/components/tooltip/tooltip.js @@ -34,11 +34,12 @@ function tooltip($document, $compile, $interpolate, $sce, $templateCache, $http, return { restrict: 'A', priority: -1, - link: function(scope, element, attrs) { - var tipHtml = '
{{text}}
'; - var tip; - var tipClassName = 'tooltip'; - var tipActiveClassName = 'tooltip-show'; + link: function($scope, element, attrs) { + let tipHtml = '
{{::text}}
'; + let tip; + let tipClassName = 'tooltip'; + let tipActiveClassName = 'tooltip-show'; + let scope = $scope.$new(); scope.tipClass = [tipClassName]; scope.text = attrs.vnTooltip || ''; @@ -116,6 +117,7 @@ function tooltip($document, $compile, $interpolate, $sce, $templateCache, $http, element.on('$destroy', function() { tip.remove(); + scope.$destroy(); }); } }