-
Notifications
You must be signed in to change notification settings - Fork 0
ECMAScript Promise chains
ythy edited this page Aug 25, 2017
·
3 revisions
案例: 通过
getData()
方法获取初始数据, 方法返回后调用下一相应方法getSpecInfo()
getData():void{
mBusinessBase.call(MProcurementServletKey.SearchGBMallItemDetail)
.then((json:UJsonRespond)=>{
...do something
return this.getSpecInfo();
})
.then((json:UJsonRespond)=>{
...do something
});
}
getSpecInfo():Promise<UJsonRespond>{
return mBusinessBase.call(MProcurementServletKey.SearchItemPriceAndQuantityInfo);
}
tell me how get back to sunshine