Skip to content

Commit

Permalink
Fixed wrong place of new readme section
Browse files Browse the repository at this point in the history
  • Loading branch information
grabbou committed Feb 22, 2015
1 parent b552ce7 commit cbe6d17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1241,10 +1241,6 @@ $scope.showData = function () {
};
````

#### Restangular fails with status code 0

This is typically caused by Cross Origin Request policy. In order to enable cross domain communication and get correct response with appropriate status codes, you must have the CORS headers attached, even in error responses. If the server does not attach the CORS headers to the response then the XHR object won't parse it, thus the XHR object won't have any response body, status or any other response data inside which typically will cause your request to fail with status code 0.

**Addendum :** If you want originalElement to be the original response object instead of having an original value for each key in your newResponse array, replace


Expand All @@ -1260,6 +1256,10 @@ By
newResponse.originalElement[key] = angular.copy(value);
````

#### Restangular fails with status code 0

This is typically caused by Cross Origin Request policy. In order to enable cross domain communication and get correct response with appropriate status codes, you must have the CORS headers attached, even in error responses. If the server does not attach the CORS headers to the response then the XHR object won't parse it, thus the XHR object won't have any response body, status or any other response data inside which typically will cause your request to fail with status code 0.

#### Why does this depend on Lodash / Underscore?

This is a very good question. I could've done the code so that I don't depend on Underscore nor Lodash, but I think both libraries make your life SO much easier. They have all of the "functional" stuff like map, reduce, filter, find, etc.
Expand Down

0 comments on commit cbe6d17

Please sign in to comment.