From 58b47a086859f749c747db468351841e24033c39 Mon Sep 17 00:00:00 2001 From: Vikas-Kumar56 Date: Wed, 7 Jun 2017 12:31:40 +0530 Subject: [PATCH 1/2] Update tooltip.js --- src/tooltip/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index dd02a077a1..f82ece4a9d 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -405,7 +405,7 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s cancelShow(); } - if (val && ttScope.isOpen) { + if (val && ttScope && ttScope.isOpen) { hide(); } }); From ec951299be8263fbf2b63db0c90f22219e95a280 Mon Sep 17 00:00:00 2001 From: Vikas-Kumar56 Date: Wed, 7 Jun 2017 15:41:00 +0530 Subject: [PATCH 2/2] Update tooltip.js There Should Be one unique event through which user can change message or destroy tooltip from element because in case of $destroy there are many library which are also listening $destroy event. So for resolving our purpose we are introducing another event $uibTooltipdestroy with which user can remove uibtooltip from element without disturbing other library like ui-grid. --- src/tooltip/tooltip.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index f82ece4a9d..afd6393f90 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -577,6 +577,13 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s removeTooltip(); ttScope = null; }); + + // Make sure tooltip is destroyed and removed When User Changes Message Or Remove From Template. + scope.$on('$uibTooltipdestroy', function onDestroyTooltip() { + unregisterTriggers(); + removeTooltip(); + ttScope = null; + }); }; } };