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

feat($resource): pass status/statusText to success callbacks #14836

Merged

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Jun 28, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature.

What is the current behavior? (You can also link to an open issue here)
Only the data/instance and the headers function are passed to success callbacks.

What is the new behavior (if this is a feature change)?
The status and statusText are also passed to the success callbacks.

Does this PR introduce a breaking change?
No. Yes. I don't know. Could be...in tests...if someone verifies what arguments their callbacks are called with...

Please check if the PR fulfills these requirements

Other information:
Fixes #8341
Closes #8841

@gkalpak
Copy link
Member Author

gkalpak commented Jun 28, 2016

Another idea (but a slightly bigger breaking change) would be to pass the whole response object as a 2nd argument and let the user get what they want from there.

Considering the potential BC (mainly in tests), I suggest we land this on 1.6.x only. Should I add a notice (i.e. is it a real BC)?

@Narretz
Copy link
Contributor

Narretz commented Jul 20, 2016

What things other than status & statusText could be realistically required from the response? On one hand, the more generic version is better because the API won't get ugly when you have to add it later anyway, but on the other hand, if no other things but status & statusText are used, then we should stick to them.

@gkalpak
Copy link
Member Author

gkalpak commented Jul 20, 2016

I can't think of anything else - just future-proofing 😄
I agree - let's avoid a bigger breaking change for now. If it turns out people need more control, we can always make the change at a later version.

@Narretz Narretz merged commit e3a378e into angular:master Aug 26, 2016
@Narretz
Copy link
Contributor

Narretz commented Aug 26, 2016

I've merged it in into master and I'm happy to merge it into 1.5.x, as breaking in tests isn't a BC to me.

@gkalpak
Copy link
Member Author

gkalpak commented Aug 26, 2016

I am fine merging it into 1.5.x too.

Narretz pushed a commit that referenced this pull request Aug 30, 2016
@gkalpak gkalpak deleted the feat-resource-pass-status-to-callbacks branch September 21, 2016 14:07
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Nov 21, 2016
petebacondarwin pushed a commit that referenced this pull request Nov 23, 2016
petebacondarwin pushed a commit that referenced this pull request Nov 24, 2016
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.

Feature request: provide HTTP status to the success callback of $resource
3 participants