回调地狱,拼接3个请求的数据
$http.get($rootScope.gateway + '/v2/stores/' + store_id + '/purchase_orders/' + id)
.success(function(data) {
$http.get('https://trybindo.com/api/v2/stores/382/listings/24308265').success(function(listing){
DashboardFactory.getUomById(listing.listing.unit_group_id).success(function(units){
let unitsArray = units.unit_group.units.map(v=>v.name)
data.purchase_order = Object.assign({}, data.purchase_order, {units: unitsArray})
console.log(data.purchase_order)
deferred.resolve( data.purchase_order );
})
})
// unit_group_id = 345
})
新建.jpg
控制器
数据
2871522119909_.pic_hd.jpg
2901522122139_.pic_hd.jpg
2891522121904_.pic_hd.jpg
[图片上传中...(2961522139203_.pic_hd.jpg-7c8846-1522147286001-0)]
2961522139203_.pic_hd.jpg
2971522147333_.pic_hd.jpg
网友评论