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

docs($http): add a note about modifying data in transformRequest #14122

Merged
merged 1 commit into from
Feb 24, 2016

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Feb 24, 2016

Closes #12468

@@ -550,6 +550,15 @@ function $HttpProvider() {
* the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,
* which allows you to `push` or `unshift` a new transformation function into the transformation chain.
*
* <div class="alert alert-warning">
* **Note:** Angular does not make a copy of the `data` parameter before it is passed into the `transformRequest` pipeline.
* That means changes to the data are not local to the transform function (since Javascript passes objects by reference).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes to properties on the data object are not local

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@Narretz Narretz force-pushed the docs-http-transform branch from 263b434 to 0749eb4 Compare February 24, 2016 16:36
@Narretz Narretz merged commit 0749eb4 into angular:master Feb 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.

TransformRequest in $http is changing scope
3 participants