how to display json array in angular 2 typescript front end by *ngFor

后端 未结 2 975
礼貌的吻别
礼貌的吻别 2021-01-27 23:43

Below is angular2 simple front end page::

       

i just did this.notes=JSON.parse(data._body); and worked remaining code is as above.

data => {
    console.log(data._body);
    this.notes=JSON.parse(data._body); // parsing here
    console.log("notes array"+this.title);
    console.log("Title :: "+this.notes.title);
},

提交回复
热议问题
title
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-28 00:13

    Html code::

{{notes.title}} {{notes.body}}