Created
November 13, 2014 11:48
-
-
Save seeruk/38161c4c7efcf28ef6ef to your computer and use it in GitHub Desktop.
cachingproxy.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Cache.proxy("foo", function() { | |
return $http({ method: "GET", url: "api/articles.json" }) | |
.then( | |
function(result) { | |
return result.data.articles; | |
}, | |
function(reason) { | |
throw new HttpException(null, reason.statusText, reason.status); | |
} | |
) | |
; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment