goodeggs / angular-cached-resource

An AngularJS module to interact with RESTful resources, even when browser is offline
MIT License
216 stars 29 forks source link

$cachedResource is not $resource #73

Open Morriz opened 9 years ago

Morriz commented 9 years ago

At the moment your $cachedResource is not a drop-in replacement for $resource, as it requires one to rewrite all the code where $resource calls get made. I suggest you mixin/enrich your functionality on the original $resource provider, enabling drop-in and later removal of your module without breaking code.

So in an ideal scenario one would just load your plugin, optionally with a configuration that contains things such as TTL per resource, and it would just work without code rewriting.

I don't have much time to do this myself, but I can advise and review ;)

felippenardi commented 8 years ago

I'm wondering if it could be done today by decorating the $resourceProvider with $cachedResource.