-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat($http): adds xhrFields to $http config object #7906
Conversation
The `xhrFields` object is passed to the XMLHttpRequest constructor making it possible to set non-standard properties on the XMLHttpRequest object. It is also possible to set the object on `$http.defaults` to use it globally. With this functionality it is possible to set the `mozSystem` and `mozAnon` properties, which is required to use angular in a packaged Firefox OS app. See https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#XMLHttpRequest() Closes angular#2318
This is awfully similar to #7903 |
Yes, I started working on it yesterday and didn't see the duplicate before I pushed it.. Sorry about that.. Like I commented on #7903, I have named it |
Closing, because in #7903 it was decided that always having a config parameter in createXhr is a bad idea. New plan is to allow a custom createXhr function (+ a default option to set arbitrary options after the object is instantiated) PRs welcome! |
I see tons of pull requests and and activity surrounding this issue, but where is the official patch and documentation? Can we link to that here and in the dozen or so issues that reference this problem? |
There hasn't been an official patch. See my comment above yours and the discussion in the issue. |
Where was that decided? I am not seeing it in that issue |
I think we do want to let people customize how they construct their XHR fields, specifically to support B2G/Gaia --- I can't really think of any other reason why anyone would want to |
However I do agree that |
@caitp Sorry, I meant passing the parameters to the xhr constructor is a bad idea (as is done in this PR) |
The
xhrFields
object is passed to the XMLHttpRequest constructor making it possible to set non-standard properties on the XMLHttpRequest object. It is also possible to set the object on$http.defaults
to use it globally. With this functionality it is possible to set themozSystem
andmozAnon
properties, which is required to use angular in a packaged Firefox OS app. See https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#XMLHttpRequest()Closes #2318