我正在使用 lodash 进行分组
_.groupBy(_.flatten(this.postReleaseArr), 'module');
返回
如何返回名称“发布后支持”、“圆 table session ”、“VOD session ” 在 *ngFor ?
我的 HTML 是
<div *ngFor="let item of postReleaseArr">
{{item}}
</div>
刚刚返回
[object Object]
[object Object]
[object Object],[object Object]
[object Object]
最佳答案
假设您的对象来自对象数组 (JSON),请使用以下代码:
<div *ngFor="let item of postReleaseArr">
{{item['Post Release Support']}} - {{item['Round Table']}} - {{item['VOD Meeting']}}
</div>
关于javascript - 获取 *ngFor 中的对象字面量顶级名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42461084/