我有一个表,其中包含来自后端的响应形成的以下数据。我需要动态地给出分页并最初获取前10条记录,并且当触发特定页面时需要相应地设置。我使用dirpaginate.js
进行分页。但我无法相应地得到数据。
HTML:
<table>
<tbody>
<tr dir-paginate="item in searchData|orderBy:sortkey:reverse|itemsPerPage:10">
<td class="col-sm-4">{{item[0].profileInfo.firstname}}
<br> {{item[0].profileInfo.lastname}}
<br>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
JS:
var req = {
"request": {
"service": {
"servicetype": "3",
"sort": {
"sortby": "firstname",
"sorttype": "asc"
},
"records": {
"start_no": $scope.pagination,
}
}
}
}
$scope.sortkey = '';
$scope.reverse = false;