Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Resource cache just passes cache to $http, but doesn't cache instances #8739

Open
@elado

Description

@elado

Seems like cached actions might be cached on $http level, but the resource instances are re-created every time. This obviously uses more memory, and also an unexpected behavior.

If I have a simple Category resource with cached query action, and I call Category.query() from multiple directives, it does loads them all at once (expected) but instances in every place are different. Editing one instance on a directive (as an ngModel or whatever) doesn't affect the others. As a temporary solution I can wrap the query function and handle the caching myself but would be great if angular-resource took care of it.

(Using latest 1.3 beta)

https://github.com/angular/angular.js/blob/master/src/ngResource/resource.js#L567

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions