@@ -36,9 +36,9 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
3636 * $tooltipProvider.options( { placement: 'left' } );
3737 * });
3838 */
39- this . options = function ( value ) {
40- angular . extend ( globalOptions , value ) ;
41- } ;
39+ this . options = function ( value ) {
40+ angular . extend ( globalOptions , value ) ;
41+ } ;
4242
4343 /**
4444 * This allows you to extend the set of trigger mappings available. E.g.:
@@ -202,7 +202,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
202202
203203 // And show the tooltip.
204204 ttScope . isOpen = true ;
205- ttScope . $digest ( ) ; // digest required as $apply is not called
205+ ttScope . $apply ( ) ; // digest required as $apply is not called
206206
207207 // Return positioning function as promise callback for correct
208208 // positioning after draw.
@@ -289,6 +289,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
289289 }
290290
291291 var unregisterTriggers = function ( ) {
292+ element . unbind ( triggers . show , toggleTooltipBind ) ;
292293 element . unbind ( triggers . show , showTooltipBind ) ;
293294 element . unbind ( triggers . hide , hideTooltipBind ) ;
294295 } ;
@@ -340,11 +341,29 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
340341 } ] ;
341342} )
342343
344+ . directive ( 'tooltipTemplateTransclude' , [ '$http' , '$compile' , '$templateCache' , function ( $http , $compile , $templateCache ) {
345+ return {
346+ link : function ( scope , elem , attrs ) {
347+ if ( scope . content ) {
348+ // TODO: How to solve the problem of pre-loading the template?
349+ // TODO: Should this be watching for changes in scope.content?
350+ var templateUrl = scope . content ,
351+ transcludeScope = scope . $parent . $parent ;
352+
353+ $http . get ( templateUrl , { cache : $templateCache } )
354+ . then ( function ( response ) {
355+ elem . html ( response . data ) ;
356+ $compile ( elem . contents ( ) ) ( transcludeScope ) ;
357+ } ) ;
358+ }
359+ }
360+ } ;
361+ } ] )
362+
343363. directive ( 'tooltipPopup' , function ( ) {
344364 return {
345365 restrict : 'EA' ,
346366 replace : true ,
347- scope : { content : '@' , placement : '@' , animation : '&' , isOpen : '&' } ,
348367 templateUrl : 'template/tooltip/tooltip-popup.html'
349368 } ;
350369} )
@@ -357,11 +376,11 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
357376 return {
358377 restrict : 'EA' ,
359378 replace : true ,
360- scope : { content : '@' , placement : '@' , animation : '&' , isOpen : '&' } ,
361379 templateUrl : 'template/tooltip/tooltip-html-unsafe-popup.html'
362380 } ;
363381} )
364382
365383. directive ( 'tooltipHtmlUnsafe' , [ '$tooltip' , function ( $tooltip ) {
366384 return $tooltip ( 'tooltipHtmlUnsafe' , 'tooltip' , 'mouseenter' ) ;
367385} ] ) ;
386+
0 commit comments