diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index 36351bc145..4659e8bdc7 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -189,14 +189,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap // Set the initial positioning. tooltip.css({ top: 0, left: 0, display: 'block' }); - - // Now we add it to the DOM because need some info about it. But it's not - // visible yet anyway. - if ( appendToBody ) { - $document.find( 'body' ).append( tooltip ); - } else { - element.after( tooltip ); - } + ttScope.$digest(); positionTooltip(); @@ -236,7 +229,13 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap removeTooltip(); } tooltipLinkedScope = ttScope.$new(); - tooltip = tooltipLinker(tooltipLinkedScope, angular.noop); + tooltip = tooltipLinker(tooltipLinkedScope, function (tooltip) { + if ( appendToBody ) { + $document.find( 'body' ).append( tooltip ); + } else { + element.after( tooltip ); + } + }); } function removeTooltip() {