I have some angular factories for making ajax calls towards legacy ASP.NET .asmx web services like so:
module.factory(\'productService\', [\"$http\",
function ($
If you are using a service that returns a promise, then inside you should put a return before the $timeout as well because that returns just another promise.
return dataService.loadSavedItem({
save_id: item.save_id,
context: item.context
}).then(function (data) {
// timeout returns a promise
return $timeout(function () {
return data;
},2000);
});
Hope it helps someone!