From: Gustavo Martin Morcuende Date: Tue, 22 Sep 2015 23:28:43 +0000 (+0200) Subject: showcase: returning from success or error (legacy promises) doesn't resolve promise X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=45eca9ce7c9f1d67d18050a06345e0ecaeb90f13;p=JavaScriptForFun showcase: returning from success or error (legacy promises) doesn't resolve promise --- diff --git a/angularjs/showcase/src/showcase/app/cars/cars.service.js b/angularjs/showcase/src/showcase/app/cars/cars.service.js index 838678f..f69f0b3 100644 --- a/angularjs/showcase/src/showcase/app/cars/cars.service.js +++ b/angularjs/showcase/src/showcase/app/cars/cars.service.js @@ -109,6 +109,9 @@ console.log('XHR SuccessAlternative for getAll. SuccessAlternative, status: ' + status); console.log('XHR SuccessAlternative for getAll. SuccessAlternative, headers (it is a function): ' + headers); console.log('XHR SuccessAlternative for getAll. SuccessAlternative, config: ' + config); + // IT IS WEIRD, BUT RETURNING FROM THIS METHOD IS USELESS BECAUSE IT DOESN'T DO ANYTHING, + // IT WON'T RESOLVE OUR PROMISE!!!! + // return data; } function error(reason) { @@ -156,6 +159,9 @@ console.log('XHR ErrorAlternative for getAll. ErrorAlternative, status: ' + status); console.log('XHR ErrorAlternative for getAll. ErrorAlternative, headers (it is a function): ' + headers); console.log('XHR ErrorAlternative for getAll. ErrorAlternative, config: ' + config); + // IT IS WEIRD, BUT RETURNING FROM THIS METHOD IS USELESS BECAUSE IT DOESN'T DO ANYTHING, + // IT WON'T RESOLVE OUR PROMISE!!!! + // return data; } function notify(notification) {