【发布时间】:2017-09-03 12:54:15
【问题描述】:
<div class="panel-body">
{{ (currentPlatformProfile | async)?.length }} <!-- line 1 -->
<table>
<tr *ngFor="let platform of {{(currentPlatformProfile | async)}}">
<td>{{platform.infoPlatform}}</td>
<td>{{platform.infoGameId}}</td>
<td>{{platform.infoChannel}}</td>
</tr>
</table>
</div>
我的 html 代码在 sn-p 中,实际上第 1 行工作正常,但在 ngFor 中却失败了
如何使用这个数组?
未处理的承诺拒绝:模板解析错误:TypeError:不能 读取未定义的属性“toUpperCase”(“ {{ (当前平台配置文件|异步)}} ]*ngFor="让平台 {{(currentPlatformProfile | async)}}"> {{plat"): ng:///AppModule/ProfilecreateComponent.html@130:24 无法绑定 '*ngFor' 因为它不是 'tr' 的已知属性。
块引用
【问题讨论】: