首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >来源Get方法返回"_isScalar":false,“Angular6”

来源Get方法返回"_isScalar":false,“Angular6”
EN

Stack Overflow用户
提问于 2018-08-31 08:03:49
回答 1查看 7.2K关注 0票数 4

我正在尝试在html页面上显示json数据。服务器上的数据显示了json数据,但是当我试图在页面上显示它时,它提供了这些数据。

{"_isScalar":false,“源”:{“_isScalar”:true,"value":{"url":"https://feeds.citibikenyc.com/stations/stations.json","body":null,"reportProgress":false,"withCredentials":false,"responseType":"json","method":"GET","headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"params":{"updates":null,"cloneFrom":null,“编码器”:{},"map":null},"urlWithParams":"https://feeds.citibikenyc.com/stations/stations.json"},"scheduler":null},"operator":{"concurrent":1}},"operator":{}},"operator":{}}

我获取数据的代码是

代码语言:javascript
复制
import { HttpClient} from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable()
export class GetdataService {
posts : any;
readonly ROOT_URL ="https://feeds.citibikenyc.com/stations/stations.json";
constructor(private http: HttpClient ) { }

getPosts()
{

this.posts = this.http.get(this.ROOT_URL );

return JSON.stringify(this.posts);
}


}
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52106855

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档