【发布时间】:2016-12-24 02:42:08
【问题描述】:
我看到 Response.json() 方法被大量使用,我自己也在使用它,但要么我遗漏了某些东西,要么 Response 类的文档不正确。
例子:
getCurrentTime() {
return this._http.get('http://date.jsontest.com/')
.map((res:Response) => res.json())
}
在 https://angular.io/docs/ts/latest/api/http/index/Response-class.html 的 Angular 站点上,我不认为该方法是 Response 类的成员。
如果 .json 不是 Response 类的成员,有人可以指出我理解其工作原理的方向吗?
或者如果文档有误,请有人说出来。
提前致谢。
【问题讨论】: