【发布时间】:2018-06-28 17:28:33
【问题描述】:
this.data 是json 对象的数组,我只是想找到一种方法来解析各个对象(在这种情况下,只需打印到控制台即可)
方法getData()之后的数据正确。这两种方法都以 this.http.put 和 this.http.get 的形式返回 observables
this.persistanceData.setData(this.data)
.subscribe((res: any) => { });
this.persistentDataService.getData()
.map(res => res.json())
.subscribe(data => data.map(item => console.log(item)))
【问题讨论】: