diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index f74096a2cb..fe511b64da 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -287,18 +287,20 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s // First things first: we don't show it anymore. ttScope.$evalAsync(function() { - ttScope.isOpen = false; - assignIsOpen(false); - // And now we remove it from the DOM. However, if we have animation, we - // need to wait for it to expire beforehand. - // FIXME: this is a placeholder for a port of the transitions library. - // The fade transition in TWBS is 150ms. - if (ttScope.animation) { - if (!transitionTimeout) { - transitionTimeout = $timeout(removeTooltip, 150, false); + if(ttScope){ + ttScope.isOpen = false; + assignIsOpen(false); + // And now we remove it from the DOM. However, if we have animation, we + // need to wait for it to expire beforehand. + // FIXME: this is a placeholder for a port of the transitions library. + // The fade transition in TWBS is 150ms. + if (ttScope.animation) { + if (!transitionTimeout) { + transitionTimeout = $timeout(removeTooltip, 150, false); + } + } else { + removeTooltip(); } - } else { - removeTooltip(); } }); }