angular - 如何在控制台中显示数组数据?
问题描述
我需要控制台已经在数组中的数据。这是数据看起来像这样。
我得到这样的数据
this.clientData.subscribe(udata => {
console.log(udata);
console.log(udata.records.name); <=== here i want to show just a name
})
解决方案
你错过了index
this.clientData.subscribe(udata => {
console.log(udata);
console.log(udata.records[0].name); <=== here use indexing
})
推荐阅读
- reactjs - 根据条件匹配应用 className
- php - MySQL 导出到 Excel 写入整个 PHP 文件
- machine-learning - MCTS 如何与“精确线”配合使用
- c# - Gremlin.Net 一次遍历获取边 Id、InV、OutV 和属性
- html - 在一行上设置样式而不更改网站上的所有行
- react-native - React Native 的核心框架如何部署到应用程序使用的设备上?
- r - 使用 ggplot2 构建箱线图
- angular - 需要使用 Angular 5 服务警告用户页面到期的解决方案吗?
- javascript - 使用 window.location.replace 后如何防止页面刷新
- java - 如何减少 Java 中的振幅数组大小?