jmdobry / angular-cache

angular-cache is a very useful replacement for the Angular 1 $cacheFactory.
http://jmdobry.github.io/angular-cache
MIT License
1.39k stars 156 forks source link

Request for some examples for using angular cache in ngResource #171

Closed dhiva closed 9 years ago

dhiva commented 9 years ago

Hi,

I understand that the latest release has support to ngResource. Could you please add some examples to the document page on using angular cache in $resource. It would really be helpful.

Thank you.

ahmed-abdulmoniem commented 9 years ago

How can we use it in ngResource?

jmdobry commented 9 years ago

With the knowledge that angular-cache can be used anywhere that $cacheFactory can be used (it's a drop in replacement for $cacheFactory), then the ngResource documentation for using $cacheFactory with ngResource and various blog posts and stackoverflow answers about the topic should provide sufficient examples.

ngResource actions support the same options as $http(config), so your knowledge of that and its documentation also tell you that there is a cache option that you can set to an instance of a cache (either one created by $cacheFactory or by angular-cache), and the cache will be used by the resource.

jmdobry commented 9 years ago

Here's an example I found on Stack Overflow: http://stackoverflow.com/questions/30466569/angular-cache-ng-resource-transformresponse-before-caching


Closing because I’m not sure this is an issue, if you are convinced that this is really a bug, please feel free to re-open the issue and add more information:

Otherwise support is done via the mailing list.