var apiList = ["venkat", "vashith", "nagesh", "utejj"];
var requestUrl = "users/add" + window.location.search;
function AddUsers() {
return $q.all(apiList.map(function (item) {
return $http({
method: 'POST',
url: requestUrl / item
//,data: item //we have internal collection use data
});
}))
.then(function (results) {
var resultObj = {};
results.forEach(function (val, i) {
resultObj[apiList[i]] = val.data;
});
return resultObj;
});
}
No comments:
Post a Comment