【发布时间】:2017-03-14 11:53:09
【问题描述】:
在这里我正在调用提供者(http 调用),它被成功调用但是 我遇到了执行流程问题。我希望输出为
4.3274
hi
but its printing
hi
4.3274
<ion-buttons end>
<button ion-button (click)="showcalculation()">Calculate</button>
</ion-buttons>
showcalculation(){
this.quoteServe.calSunShine().subscribe(data=>{
console.log(data);
})
console.log("hi");
}
**provider method:**
calSunShine(){
const body=new URLSearchParams();
const header= new Headers();[enter image description here][1]
header.append('Content-Type', 'application/x-www-form-urlencoded');
return this.http.post(this.base_url+"restInsertQuote/getsunshine", body.toString(),{headers : header}).map(response => response.json());
}
[1]: https://i.stack.imgur.com/zHyQ3.png
【问题讨论】:
标签: angular typescript ionic2