在Angular 6中,我得到了下面的错误信息
public getList() {
return this.http.get(environment.serverUrl +'/vmsdata/v1/tftoport/customer/1001')
.toPromise()
.then(response => response.json()
.then(json => {
console.log('data', json.items);
return json.items;
});
}对于行.then(response => response.json(),错误是[ts] Property 'json' does not exist on type 'Object'。
对于行,.then(json => {错误为[ts] Parameter 'json' implicitly has an 'any' type.
发布于 2018-08-02 13:28:00
在Angular 6中,您不需要将数据映射到json,因为angular 6默认提供了json。
https://stackoverflow.com/questions/51644258
复制相似问题