ng-tasty
ng-tasty copied to clipboard
.success problem with angular 1.6.0
Since angular 1.5 $http's deprecated custom callback methods - success() and error() - have been removed in angular 1.6. ngTasty needs some changes. https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$http
ng-tasty-tpls.js from 559 and 739 this code needs to be changed:
if (scope.templateUrl) {
$http.get(scope.templateUrl, { cache: $templateCache })
.success(function(templateContent) {
element.replaceWith($compile(templateContent)(scope));
});
}
to this:
if (scope.templateUrl) {
$http.get(scope.templateUrl, { cache: $templateCache })
.then(function onSuccess(response) {
element.replaceWith($compile(response.data)(scope));
}, function onError(response) {
console.log(response.status,response.statusText);
});
}
This maybe needs some confirmation, seems to work for me just fine. If the project is still alive I can make a pull request.
+1 same issue here: Angular 1.6.1 and some templateUrl-calls fail due to success being deprecated in 1.6.x