问题
数据异步加载并正确显示,但不出现分页。如果你能帮忙,谢谢。
HTML
<table st-safe-src="update" st-table="displayedItemList" class="table table-striped table-bordered">
<thead>
<tr>
<th>Field1</th>
<th>Field2</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in displayedItemList">
<td>{{item.Field1}}</td>
<td>{{item.Field2}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2" class="text-center">
<div st-pagination="" st-items-by-page="10" st-displayed-pages="7"></div>
</td>
</tr>
</tfoot>
</table>
JavaScript
$scope.itemList = [];
$scope.displayedItemList = [];
$scope.update = 0;
$scope.initialize = function ()
{
var d = new $.Deferred();
itemService.getItems().then(function (data) {
$scope.itemList = data;
$scope.displayedItemList = [].concat($scope.itemList);
$scope.update++;
d.resolve();
});
return d;
}
替代尝试
...相同的结果。
<table st-safe-src="itemList" ...