Mal*_*iri 5 typescript angular
我正在从 api 获取数据并希望显示在表格中,并且在表格中我有 # 列用于序列号现在我想显示到目前为止我已经完成的序列号但是当我在每一页上显示 1 到 10 个序列号时更改显示的页面 1- 10 下一页加载时从 1 开始计数
<tbody>
<tr *ngFor="let user of _data | paginate: { itemsPerPage: 10, currentPage: p }; let i=index">
<th>{{i + 1}}</th>
<th>{{user.FirstName}}</th>
<th>{{user.LastName}}</th>
<th>{{user.Email}}</th>
<th>
<button *ngIf="user.IsActive==false" class="btn btn-success btn-xs" (click)="changeStatus(user.Id)"> <i class="fa fa-check"></i> Active </button>
<button *ngIf="user.IsActive==true" class="btn btn-danger btn-xs" (click)="changeStatus(user.Id)"><i class="fa fa-trash-o"></i> Block</button>}}
</th>
</tr>
</tbody>Run Code Online (Sandbox Code Playgroud)
答案是。
{{ (config.currentPage - 1) * config.itemsPerPage + i +1 }}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11501 次 |
| 最近记录: |