-2
我的組件服務:如何寫角2
getDetailsByPhone(phone: any) {
this.phoneSearchDetails = this.appService.manageHttp('get', 'search?number='+phone, '');
}
我的服務:
manageHttp(method: any, url: any, body: any) {
this.headers = this.config.setHeaders();
var urlto = this.config.serverUrl +''+url;
return this.http.get(urlto,{ headers: this.headers }).map((response: Response) => {
return response.json();
});
}
有了這個代碼,我不能看到network.I會響應我不知道什麼是錯的,我沒有看到控制檯中的任何錯誤。任何人都可以請建議help.Thanks。
[Angular 2 http get not get]可能重複(https://stackoverflow.com/questions/41381200/angular-2-http-get-not-getting) – 0mpurdy