Replace angular.toJson escape function with JSON.stringify
// Set item
_this.$$storage.setItem(_this.$$prefix + '.data.' + key, angular.toJson(item));
Angular only escape request object due possibility of scope variable in request in it's default transformRequest implementation, which can be disabled.
Response isn't escaped at all and cache provider MUST NOT.
This make caching function break some responses due to cleaning of dollar starting variables names so cache brokes it's content and on second request return cleaned object instead of original.
On keys it's can be stayed at old version, changes needed only for value object. But I think it's all works as expected and removed unneeded wrapper in this case.
Thanks for fast response.
Replace
angular.toJson
escape function withJSON.stringify
Angular only escape request object due possibility of scope variable in request in it's default transformRequest implementation, which can be disabled.
Response isn't escaped at all and cache provider MUST NOT.
This make caching function break some responses due to cleaning of dollar starting variables names so cache brokes it's content and on second request return cleaned object instead of original.