【发布时间】:2016-12-13 14:25:34
【问题描述】:
Angular2中http请求中的.json()函数有什么作用?
示例代码:
this.http.get('http://localhost:8080/getName')
.subscribe(res => this.names = res.json());
我猜它类似于 javascript 的 JSON.parse() ?
【问题讨论】:
-
方法来自Fetch规范,定义为here。
标签: javascript json angular