0
테이블에 간단한 카운터를 추가하려면 어떻게합니까?테이블의 행 카운터
<tr *ngFor="let car of cars; let i = index">
<td>{{system.systemID}}</td>
</tr>
지금 i
이 카운터 : (그것을 사용 단지 HTML 가능한 경우) 나는 그것은 실제로 매우 간단
HTML
<div class="table-responsive">
<table id="carTable" class="table table-bordred table-striped">
<thead>
<th>Car ID</th>
</thead>
<tbody>
<tr *ngFor="let car of cars">
<td>{{system.systemID}}</td>
</tr>
</tbody>
</table>
</div>
이 답변을 확인하십시오 : https://stackoverflow.com/questions/43443963/angular2-ngfor-how-to-count-the-number-of-looping-values –
여기에 [전체 목록] (https : // angular.io/api/common/NgForOf#local-variables)를 사용할 수 있습니다. –