Skip to content

Commit 920b052

Browse files
committed
fix thanks to @nhardy PR #213
1 parent 2e749ee commit 920b052

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-tooltips",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Angular.js tooltips module.",
55
"authors": [
66
"Filippo Oretti <filippo.oretti@gmail.com",

dist/angular-tooltips.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
22
* angular-tooltips
3-
* 1.2.1
3+
* 1.2.2
44
*
55
* Angular.js tooltips module.
66
* http://720kb.github.io/angular-tooltips
77
*
88
* MIT license
9-
* Tue May 23 2017
9+
* Tue Jun 20 2017
1010
*/
1111
@-webkit-keyframes animate-tooltip {
1212
0% {

dist/angular-tooltips.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
22
* angular-tooltips
3-
* 1.2.1
3+
* 1.2.2
44
*
55
* Angular.js tooltips module.
66
* http://720kb.github.io/angular-tooltips
77
*
88
* MIT license
9-
* Tue May 23 2017
9+
* Tue Jun 20 2017
1010
*/
1111
/*global angular,window*/
1212
(function withAngular(angular, window) {
@@ -279,7 +279,7 @@
279279
}
280280
};
281281
}
282-
, tooltipDirective = /*@ngInject*/ ['$log', '$http', '$compile', '$timeout', '$controller', '$injector', 'tooltipsConf', '$templateCache', function tooltipDirective($log, $http, $compile, $timeout, $controller, $injector, tooltipsConf, $templateCache) {
282+
, tooltipDirective = /*@ngInject*/ ['$log', '$http', '$compile', '$timeout', '$controller', '$injector', 'tooltipsConf', '$templateCache', '$q', function tooltipDirective($log, $http, $compile, $timeout, $controller, $injector, tooltipsConf, $templateCache, $q) {
283283

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

@@ -541,17 +541,17 @@
541541

542542
var template = $templateCache.get(tooltipTemplateUrl);
543543

544-
if (typeof template === 'undefined') {
545-
546-
// How should failing to load the template be handled?
547-
template = $http.get(tooltipTemplateUrl).then(function onGetTemplateSuccess(response) {
548-
549-
return response.data;
550-
});
551-
$templateCache.put(tooltipTemplateUrl, template);
544+
if (typeof template !== 'undefined') {
545+
// Wrap template in a Promise so that getTemplate always returns a Promise
546+
return $q.resolve(template);
552547
}
553-
554-
return template;
548+
549+
// How should failing to load the template be handled?
550+
return $http.get(tooltipTemplateUrl).then(function onGetTemplateSuccess(response) {
551+
$templateCache.put(tooltipTemplateUrl, response.data);
552+
553+
return response.data;
554+
});
555555
}
556556
, onTooltipTemplateChange = function onTooltipTemplateChange(newValue) {
557557

dist/angular-tooltips.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-tooltips.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-tooltips.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-tooltips",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Angular.js tooltips module.",
55
"homepage": "http://720kb.github.io/angular-tooltips",
66
"main": "index.js",

0 commit comments

Comments
 (0)