diff options
| author | Vojta Jina | 2011-10-19 10:47:17 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-11-30 11:17:22 -0500 |
| commit | feacf608eefa8cc64845a643f7270c9c3a16d1b8 (patch) | |
| tree | 43b13081c41f17b7994577c6cb02e6216f5c5b30 /src/service/resource.js | |
| parent | fe633dd0cf3d52f84ce73f486bcbd4e1d3058857 (diff) | |
| download | angular.js-feacf608eefa8cc64845a643f7270c9c3a16d1b8.tar.bz2 | |
fix($resource): to work with $http, $httpBackend services
Breaks Disabling $resource caching for the moment.
Diffstat (limited to 'src/service/resource.js')
| -rw-r--r-- | src/service/resource.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/service/resource.js b/src/service/resource.js index 2082b9ed..8fe27f1b 100644 --- a/src/service/resource.js +++ b/src/service/resource.js @@ -3,15 +3,14 @@ /** * @ngdoc object * @name angular.module.ng.$resource - * @requires $xhr.cache + * @requires $http * * @description * A factory which creates a resource object that lets you interact with * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources. * * The returned resource object has action methods which provide high-level behaviors without - * the need to interact with the low level {@link angular.module.ng.$xhr $xhr} service or - * raw XMLHttpRequest. + * the need to interact with the low level {@link angular.module.ng.$http $http} service. * * @param {string} url A parameterized URL template with parameters prefixed by `:` as in * `/user/:username`. @@ -57,7 +56,7 @@ * 'remove': {method:'DELETE'}, * 'delete': {method:'DELETE'} }; * - * Calling these methods invoke an {@link angular.module.ng.$xhr} with the specified http method, + * Calling these methods invoke an {@link angular.module.ng.$http} with the specified http method, * destination and parameters. When the data is returned from the server then the object is an * instance of the resource class `save`, `remove` and `delete` actions are available on it as * methods with the `$` prefix. This allows you to easily perform CRUD operations (create, read, @@ -128,7 +127,7 @@ * The object returned from this function execution is a resource "class" which has "static" method * for each action in the definition. * - * Calling these methods invoke `$xhr` on the `url` template with the given `method` and `params`. + * Calling these methods invoke `$http` on the `url` template with the given `method` and `params`. * When the data is returned from the server then the object is an instance of the resource type and * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD * operations (create, read, update, delete) on server-side data. @@ -201,8 +200,8 @@ </doc:example> */ function $ResourceProvider() { - this.$get = ['$xhr.cache', function($xhr){ - var resource = new ResourceFactory($xhr); + this.$get = ['$http', function($http) { + var resource = new ResourceFactory($http); return bind(resource, resource.route); }]; } |
