diff options
| author | Alexander Shtuchkin | 2013-04-17 02:08:04 +0400 | 
|---|---|---|
| committer | Vojta Jina | 2013-05-23 14:18:29 -0700 | 
| commit | 05772e15fbecfdc63d4977e2e8839d8b95d6a92d (patch) | |
| tree | 5bac9f0e5861b629fc63fd1f8e57df90d2ddb6be /karma-jquery.conf.js | |
| parent | da5f537ccdb0a7b4155f13f7a70ca7981ad6f689 (diff) | |
| download | angular.js-05772e15fbecfdc63d4977e2e8839d8b95d6a92d.tar.bz2 | |
feat($resource): expose promise instead of only $then
- Instance or collection have `$promise` property which is the initial promise.
- Add per-action `interceptor`, which has access to entire $http response object.
BREAKING CHANGE: resource instance does not have `$then` function anymore.
Before:
Resource.query().$then(callback);
After:
Resource.query().$promise.then(callback);
BREAKING CHANGE: instance methods return the promise rather than the instance itself.
Before:
resource.$save().chaining = true;
After:
resource.$save();
resourve.chaining = true;
BREAKING CHANGE: On success, promise is resolved with the resource instance rather than http
response object.
Use interceptor to access the http response object.
Before:
Resource.query().$then(function(response) {...});
After:
var Resource = $resource('/url', {}, {
  get: {
    method: 'get',
    interceptor: {
      response: function(response) {
        // expose response
        return response;
      }
    }
  }
});
Diffstat (limited to 'karma-jquery.conf.js')
0 files changed, 0 insertions, 0 deletions
