且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Angular 4从HTTP获取请求显示JSON数据

更新时间:2021-08-01 05:46:09

您可以使用 json管道一个>.在您的模板中:

You can use the json pipe. In your template:

<pre>Data Obtained is: {{ data | json }}</pre>

此外,您还必须将data属性的类型更改为any而不是string.

Also you have to change the type of your data property to any instead of string.