view raw
iamgopal iamgopal - 1 year ago 65
AngularJS Question

angularjs: how to add caching to resource object?

To add caching inside http is pretty straight forward. ( by passing cache=true )$http has Cache option.

How do I add similar functionality in $resource in angularjs ?


Since 1.1.2 (commit), all the $httpConfig options are directly exposed in $resource action objects:

return {
  Things: $resource('url/to/:thing', {}, {
    list : {
      method : 'GET',
      cache : true