我使用Http.get来检索配置文件。我成功地做了很多次,但这次没有。我没有看到我的控制台中的痕迹,也没有看到错误,即使我正在使用.catch。这可能是我的问题?Angular 2 Http.get没有响应
this._http.get('./assets/dashboard/json/config.json')
.map((response: Response) => {
console.log(response.json());
})
.catch((error: any) => Observable.throw(error || 'Server error'));
你必须以火'http.get()'方法 – WildDev
重复的http认购本://计算器。 com/q/41381200/3001761 – jonrsharpe
[Angular 2 http get not get]可能重复(http://stackoverflow.com/questions/41381200/angular-2-http-get-not-getting) – echonax