-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat(http): Add 'useLegacyMethods' to $httpProvider #12112
Conversation
I like the idea behind this. |
A few things
|
|
Perhaps something like this would work: 38fbe3e |
This would close #10508 |
aecb954
to
3ead869
Compare
Sorry, it took me way too long to get back to this. I've changed the documentation to to mainly cover Small aside: Once this is merged, it would be great if this could be uplifted to 1.4, as this would allow switching the default to off in 1.5. |
} | ||
else { | ||
promise.success = function() { | ||
throw namespaceMinErr('nosuccess', 'The method `success` on the $http result has been disabled.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be $httpMinErr
not namespaceMinErr
.
Also we must create error docs for these errors in https://github.com/angular/angular.js/tree/master/docs/content/error/%24http
@realityking - thanks for improving this. Just a couple of issues with the minerr stuff and then we are good to go. |
If we default to false then this is a breaking change and needs to go into 1.5 |
I've fixed minErr and added the tests. Is there a script to generate the scaffolding for the error docs or is that all by hand? As for 1.5, my I idea was to ship this with default true in 1.4.x and change the default to false in 1.5. That would allow people to fix their libraries and apps ahead of the release. Also, we'd get rid of the legacy methods being front and center in the docs. |
That is better. For the error doc, you just make a copy of a file like https://github.com/angular/angular.js/blob/master/docs/content/error/%24http/badreq.ngdoc and doctor it to your needs. The rest is magic. One last comment about the provider method, I feel that |
For now it defaults to true. This will open up a path to remove them. DEPRECATION NOTICE: The methods 'success' and 'error' on promises returned by $http are now deprecated.
I think I've addressed everything. |
I will land this week. |
The legacy methods, `success` and `error`, have been deprecated. Set this to `false` to cause `$http` to throw an error if these methods are used in the application. For now it defaults to `true`. In a future release we will remove these methods altogether. DEPRECATION NOTICE: The legacy methods 'success' and 'error' on promises returned by $http are now deprecated. Closes angular#12112
The legacy methods, `success` and `error`, have been deprecated. Set this to `false` to cause `$http` to throw an error if these methods are used in the application. For now it defaults to `true`. In a future release we will remove these methods altogether. DEPRECATION NOTICE: The legacy methods 'success' and 'error' on promises returned by $http are now deprecated. Closes angular#12112
The legacy methods, `success` and `error`, have been deprecated. Set this to `false` to cause `$http` to throw an error if these methods are used in the application. For now it defaults to `true`. In a future release we will remove these methods altogether. DEPRECATION NOTICE: The legacy methods 'success' and 'error' on promises returned by $http are now deprecated. Closes angular#12112 Closes angular#10508
The legacy methods, `success` and `error`, have been deprecated. Set this to `false` to cause `$http` to throw an error if these methods are used in the application. For now it defaults to `true`. In a future release we will remove these methods altogether. DEPRECATION NOTICE: The legacy methods 'success' and 'error' on promises returned by $http are now deprecated. Closes angular#12112 Closes angular#10508
For now it defaults to true. This will open up a path to remove the short hand methods in the long run.