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 ;)
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 ;)