Skip to content

Commit cbe6d17

Browse files
committed
Fixed wrong place of new readme section
1 parent b552ce7 commit cbe6d17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,10 +1241,6 @@ $scope.showData = function () {
12411241
};
12421242
````
12431243

1244-
#### Restangular fails with status code 0
1245-
1246-
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.
1247-
12481244
**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
12491245

12501246

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

1259+
#### Restangular fails with status code 0
1260+
1261+
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.
1262+
12631263
#### Why does this depend on Lodash / Underscore?
12641264

12651265
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.

0 commit comments

Comments
 (0)