SIGN IN SIGN UP
angular / angular.js UNCLAIMED

AngularJS - HTML enhanced for web apps!

0 0 0 JavaScript

feat(http): support request/response promise chaining

myApp.factory('myAroundInterceptor', function($rootScope, $timeout) {
    return function(configPromise, responsePromise) {
        return {
            request: configPromise.then(function(config) {
                return config
            });
            response: responsePromise.then(function(response) {
                return 'ha!';
            }
        });
}

myApp.config(function($httpProvider){
    $httpProvider.aroundInterceptors.push('myAroundInterceptor');
});
S
Sylvester Keil committed
4ae46814ff4e7c0bbcdbbefc0a97277283a84065
Parent: 5c735eb
Committed by James deBoer <james@huronbox.com> on 3/27/2013, 8:13:59 PM