Skip to content

Instantly share code, notes, and snippets.

@ccnokes
Created August 21, 2017 02:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ccnokes/054d28811c73782c8d946d2318d493d5 to your computer and use it in GitHub Desktop.
AngularJS $http cache
// this will cache the response indefinitely in a cache created via $cacheFactory
// that cache is shared globally among all $http requests
$http.get('http://pokeapi.co/api/v2/pokemon/1/', {
cache: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment