我想在我的html代码中显示数组的长度。数组列表包含另一个数组列表,因此我必须在迭代外部数组时显示内部数组列表的长度
这是我的html代码
<div class="col-xs-12 col-sm-4 col-md-3 col-lg-2 cols" *ngFor="let productMapper of printProducts">
<md-card>
<div (click)=" gotoLink(productMapper)">
<div class="text-center img-wrapper">
<img [src]="productMapper.product.imagePath" class="img-responsive" />
</div>
<div class="divider"></div>
<div class="text-center divider_text" title="{{productMapper.product.productName}}">
<span> {{productMapper.product.productName}} </span>
</div>
</div>
<div class="starRatingBlock text-center" (click)="viewComments($event);">
<span class="commentsBlock">
<i class="fa fa-commenting-o" aria-hidden="true"> {{productMapper.surveyData.length}}</i>
</span>
</div>
<md-card>
</div>
我尝试了此方法,但不起作用:{{productMapper.surveyData.length}}
答案 0 :(得分:2)
将aria-hidden
属性设置为false
<i class="fa fa-commenting-o" aria-hidden="false"> {{productMapper.surveyData.length}}</i>