Thank you for this post. I was trying to figure out how I could return a promise for a cached response in stead of a $http. I'm going to try and implement this. Since I'm only using get() it should work.
I don't understand why angularjs makes $http use a different promise callback.
By the way I think the last solution has a small typo: .error(deferred.resolve); => .error(deferred.reject);
Comment
Thank you for this post.
I was trying to figure out how I could return a promise for a cached response in stead of a $http. I'm going to try and implement this. Since I'm only using get() it should work.
I don't understand why angularjs makes $http use a different promise callback.
By the way I think the last solution has a small typo:
.error(deferred.resolve); => .error(deferred.reject);