Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions lib/angular-tooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
}
};
}
, tooltipDirective = /*@ngInject*/ ['$log', '$http', '$compile', '$timeout', '$controller', '$injector', 'tooltipsConf', '$templateCache', function tooltipDirective($log, $http, $compile, $timeout, $controller, $injector, tooltipsConf, $templateCache) {
, tooltipDirective = /*@ngInject*/ ['$log', '$http', '$compile', '$timeout', '$controller', '$injector', 'tooltipsConf', '$templateCache', '$q', function tooltipDirective($log, $http, $compile, $timeout, $controller, $injector, tooltipsConf, $templateCache, $q) {

var linkingFunction = function linkingFunction($scope, $element, $attrs, $controllerDirective, $transcludeFunc) {

Expand Down Expand Up @@ -531,17 +531,17 @@

var template = $templateCache.get(tooltipTemplateUrl);

if (typeof template === 'undefined') {

// How should failing to load the template be handled?
template = $http.get(tooltipTemplateUrl).then(function onGetTemplateSuccess(response) {

return response.data;
});
$templateCache.put(tooltipTemplateUrl, template);
if (typeof template !== 'undefined') {
// Wrap template in a Promise so that getTemplate always returns a Promise
return $q.resolve(template);
}

return template;

// How should failing to load the template be handled?
return $http.get(tooltipTemplateUrl).then(function onGetTemplateSuccess(response) {
$templateCache.put(tooltipTemplateUrl, response.data);

return response.data;
});
}
, onTooltipTemplateChange = function onTooltipTemplateChange(newValue) {

Expand Down