|
3 | 3 | /** |
4 | 4 | * @ngdoc object |
5 | 5 | * @name angular.module.ng.$resource |
6 | | - * @requires $xhr.cache |
| 6 | + * @requires $http |
7 | 7 | * |
8 | 8 | * @description |
9 | 9 | * A factory which creates a resource object that lets you interact with |
10 | 10 | * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources. |
11 | 11 | * |
12 | 12 | * The returned resource object has action methods which provide high-level behaviors without |
13 | | - * the need to interact with the low level {@link angular.module.ng.$xhr $xhr} service or |
14 | | - * raw XMLHttpRequest. |
| 13 | + * the need to interact with the low level {@link angular.module.ng.$http $http} service. |
15 | 14 | * |
16 | 15 | * @param {string} url A parameterized URL template with parameters prefixed by `:` as in |
17 | 16 | * `/user/:username`. |
|
57 | 56 | * 'remove': {method:'DELETE'}, |
58 | 57 | * 'delete': {method:'DELETE'} }; |
59 | 58 | * |
60 | | - * Calling these methods invoke an {@link angular.module.ng.$xhr} with the specified http method, |
| 59 | + * Calling these methods invoke an {@link angular.module.ng.$http} with the specified http method, |
61 | 60 | * destination and parameters. When the data is returned from the server then the object is an |
62 | 61 | * instance of the resource class `save`, `remove` and `delete` actions are available on it as |
63 | 62 | * methods with the `$` prefix. This allows you to easily perform CRUD operations (create, read, |
|
128 | 127 | * The object returned from this function execution is a resource "class" which has "static" method |
129 | 128 | * for each action in the definition. |
130 | 129 | * |
131 | | - * Calling these methods invoke `$xhr` on the `url` template with the given `method` and `params`. |
| 130 | + * Calling these methods invoke `$http` on the `url` template with the given `method` and `params`. |
132 | 131 | * When the data is returned from the server then the object is an instance of the resource type and |
133 | 132 | * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD |
134 | 133 | * operations (create, read, update, delete) on server-side data. |
|
201 | 200 | </doc:example> |
202 | 201 | */ |
203 | 202 | function $ResourceProvider() { |
204 | | - this.$get = ['$xhr.cache', function($xhr){ |
205 | | - var resource = new ResourceFactory($xhr); |
| 203 | + this.$get = ['$http', function($http) { |
| 204 | + var resource = new ResourceFactory($http); |
206 | 205 | return bind(resource, resource.route); |
207 | 206 | }]; |
208 | 207 | } |
0 commit comments