[英]Add pagination to table Angular 2
我想在我自己的bootstrap表底部添加分页角度
我不想使用表中的一个示例。
谁能帮我 ?
<table class='table table-bordered table-striped table-responsive table-hover' id="table" style="margin-top: 2%">
<thead>
<tr>
<th rowspan="2">Id boitier</th>
<th rowspan="2">Id phase</th>
<th rowspan="2">Power</th>
<th colspan="3">Voltage</th>
<th rowspan="2">Date</th>
<th rowspan="2">Time</th>
<th rowspan="2">Details</th>
</tr>
<tr>
<th>Max</th>
<th>Min</th>
<th>Moy</th>
</tr>
</thead>
<tbody>
<tr *ngFor='let cursen of cursens'>
<td >{{cursen.id_boitier}}</td>
<td>{{cursen.id_phase}}</td>
<td>{{cursen.power}}</td>
<td>{{cursen.voltage.Max}}</td><td>{{cursen.voltage.Min}}</td><td>{{cursen.voltage.Moy}}</td>
<td>{{cursen.date | date: 'dd/MM/yyyy'}}</td>
<td>{{cursen.date | date:'HH:mm:ss'}}</td>
<td><a (click)="onSelect(cursen)">alaa</a></td>
</tr>
</tbody>
</table>
这是一个例子:
从这里开始分页
在视图中:
<tr ng-repeat="cursen in cursens | pagination: pageNo * pageSize | limitTo: pageSize>
...
</tr>
在js文件中:
app.filter('pagination', function()
{
return function(input, start)
{
start = +start;
return input.slice(start);
};
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.