Angular 4 Display JSON Data from HTTP Get Request

前端 未结 2 1609
萌比男神i
萌比男神i 2021-02-06 02:01

I have a simple Angular 4 application which is contacting a HTTP REST server and this server is simply returning a JSON payload and I would like to display this JSON payload as

2条回答
  •  自闭症患者
    2021-02-06 02:21

    You can use the json pipe. In your template:

    Data Obtained is: {{ data | json }}

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

提交回复
热议问题