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

Return the same data to success as to $promise.then #3817

Closed
wants to merge 2 commits into from

Conversation

willtj
Copy link
Contributor

@willtj willtj commented Aug 30, 2013

Feel free to reject if I've misunderstood this, but I was expecting my success() callback to receive the same arguments as passed to $promise.then(). Currently the response interceptor gets bypassed when using the success() approach.

@jankuca
Copy link
Contributor

jankuca commented Aug 30, 2013

Can you elaborate? A quick example of your desired usage would help us to suggest a better solution.

@willtj
Copy link
Contributor Author

willtj commented Aug 30, 2013

Sure - here's a JSFiddle: http://jsfiddle.net/SH26x/1/

In that fiddle there are 4 example $resource calls. I would expect both examples 3 and 4 to use the interceptor and to return the same result, but the interceptor is only called when using $promise.then, not when using the success callback.

@jankuca
Copy link
Contributor

jankuca commented Aug 30, 2013

Your change breaks many tests and changes the behavior of $resource quite a lot. See my PR (#3823) for the correct fix.

@jankuca jankuca closed this Aug 30, 2013
@willtj
Copy link
Contributor Author

willtj commented Aug 31, 2013

Lovely, thanks!

btford pushed a commit to btford/angular.js that referenced this pull request Oct 2, 2013
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants