我尝试在包含其他集合的集合上使用*ngFor。
<div class="card-deck" *ngFor="let cardDeck of recentlyAdded; let i=index">
<div class="card" *ngFor="let documentary of cardDeck">
<img [src]="getSantizeUrl(documentary.poster)" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">{{ documentary.title }}</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
..。
pastebin其他代码https://pastebin.com/AP1Vwa7P
没有控制台错误,只有html源代码中有这样的错误:
<!--bindings={
"ng-reflect-ng-for-of": "[object Set]"
}-->
发布于 2019-09-19 01:52:47
要迭代Set
,首先必须将其转换为Array
,然后遍历它。
let arrayOfSet= Array.from(pass your set)
https://stackoverflow.com/questions/57998201
复制相似问题