Javascript AngularJS-如何在$http响应中传递附加参数

Javascript AngularJS-如何在$http响应中传递附加参数,javascript,ajax,angularjs,angular-promise,Javascript,Ajax,Angularjs,Angular Promise,如何将附加配置传递给$http服务响应?代码如下: var promises = []; angular.forEach(rows, function(rowIterator) { var additionalConfig = { config1: rowIterator.config1, config2: rowIterator.config2 } promise = $http({ method: "get",

如何将附加配置传递给$http服务响应?代码如下:

var promises = [];
angular.forEach(rows, function(rowIterator) {
    var additionalConfig = {
      config1: rowIterator.config1,
      config2: rowIterator.config2
    }

    promise = $http({
        method: "get",
        url: "http://domain.com/" + rowIterator.videoId + '?appName=playlist',
        params: {}
    });
    promises.push(promise);                   
});

return $q.all(promises).then(function(data) {
    // handle data from all promises WITH passed custom configs
});

那么,我如何读取$q内的所有从“additionalConfig”传递的配置获取的数据呢?

这是一个暗中的冒险,但是如何链接这样的响应承诺呢

promises.push(promise.then(function(response) {
    return {
        response: response,
        additionalConfig: additionalConfig;
    };
}));
然后

return $q.all(promises).then(function(data) {
    angular.forEach(data, function(obj) {
        console.log('Response', obj.response);
        console.log('Additional config', obj.additionalConfig);
    });
});

你真的需要澄清这个问题。在$q.all.then处理程序中,我不知道您正在尝试做什么或想要实现什么。我希望不仅能够从ajax响应中访问数据,而且能够从变量additionalConfig中访问数据-所以问题是如何通过$http服务传递此对象,以便能够通过ajax响应访问它-这已经足够清楚了现在?我想这与isse类似——但我想用angularJS$q服务解决这个问题。