From c3bd5dc88de33cca4b6494343c7876aa513a0f71 Mon Sep 17 00:00:00 2001 From: Geoff Tripoli Date: Mon, 12 Dec 2016 13:04:09 -0800 Subject: [PATCH] Fix to support angular 1.6.x --- angular-busy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/angular-busy.js b/angular-busy.js index 557435c..ac35e41 100755 --- a/angular-busy.js +++ b/angular-busy.js @@ -210,7 +210,7 @@ angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusy currentTemplate = options.templateUrl; backdrop = options.backdrop; - $http.get(currentTemplate,{cache: $templateCache}).success(function(indicatorTemplate){ + $http.get(currentTemplate,{cache: $templateCache}).then(function(indicatorTemplate){ options.backdrop = typeof options.backdrop === 'undefined' ? true : options.backdrop; @@ -220,7 +220,7 @@ angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusy element.append(backdropElement); } - var template = '
' + indicatorTemplate + '
'; + var template = '
' + indicatorTemplate.data + '
'; templateElement = $compile(template)(templateScope); angular.element(templateElement.children()[0]) @@ -231,7 +231,7 @@ angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusy .css('bottom',0); element.append(templateElement); - }).error(function(data){ + }, function(data){ throw new Error('Template specified for cgBusy ('+options.templateUrl+') could not be loaded. ' + data); }); }