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

feat($resource): add support for wrapped responses #6139

Closed
wants to merge 1 commit into from

Conversation

stephenleicht
Copy link

add a resourceData field on the action configuration. This allows you to specify which field in the response should be turned into the resource object instead of the whole thing always being decorated. You can use a string to use just a single simple field or a function for more advanced control

Closes #6138

add a resourceData field on the action configuration. This allows you to specify which field in the response should be turned into the resource object instead of the whole thing always being decorated. You can use a string to use just a single simple field or a function for more advanced control

Closes angular#6138
@tbosch tbosch self-assigned this Feb 6, 2014
@tbosch tbosch added this to the Backlog milestone Feb 6, 2014
@tbosch
Copy link
Contributor

tbosch commented Feb 6, 2014

You can use transformResponse for this purpose, sorry.

@tbosch tbosch closed this Feb 6, 2014
@stephenleicht
Copy link
Author

If you use transformResponse you lose access to the rest of the wrapper data. Doing it this way you can still use interceptor to get access to the rest of it. See #6138 for a more in depth explanation.

Is there perhaps something I'm missing in transformResponse that would let me get the unwrapped resource and preserve the rest of the data?

@stephenleicht stephenleicht deleted the wrapped-reponse branch February 6, 2014 16:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat($resource): add support for wrapped responses
2 participants