Request for some examples for using angular cache in ngResource
Closed this issue · 3 comments
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.
How can we use it in ngResource?
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.
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:
- good - Your versions of Angular, Angular-cache, etc, relevant console logs/error, code examples that revealed the issue
- better - A plnkr, fiddle, or bin that demonstrates the issue
- best - A Pull Request that fixes the issue, including test coverage for the issue and the fix
Otherwise support is done via the mailing list.