首页 > 解决方案 > 如何在控制台中显示数组数据?

问题描述

我需要控制台已经在数组中的数据。这是数据看起来像这样。

我得到这样的数据

在此处输入图像描述

 this.clientData.subscribe(udata => {
 console.log(udata);
 console.log(udata.records.name);  <=== here i want to show just a name 

})

标签: angularionic-framework

解决方案


你错过了index

this.clientData.subscribe(udata => {
     console.log(udata);
     console.log(udata.records[0].name);  <=== here use indexing
})

推荐阅读