我的智能表,我不知道为什么分页和过滤器不起作用。任何帮助将不胜感激。在这里检查完整的plunker。
http://plnkr.co/edit/urszFqto8xM6OCy9n1Fo?p=preview
查看
<table st-table="dataList" class="table table-striped">
<thead>
<tr>
<th>Total Goods</th>
<th>Grand Total</th>
<th>Merchant ID</th>
<th>Order Id</th>
<th>Status</th>
</tr>
<tr>
<th colspan="3"><input st-search="" class="form-control" placeholder="global search ..." type="text"/></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in dataList">
<td>{{data.goods_total}}</td>
<td>{{data.grand_total}}</td>
<td>{{data.m_id}}</td>
<td>{{data.order_id}}</td>
<td>{{data.status}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-center">
<div st-pagination="" st-items-by-page="itemsByPage"></div>
</td>
</tr>
</tfoot>
</table>
控制器
var app = angular.module('myApp', ['smart-table','sampleService'])
.controller('sampleCtrl', ['$scope','$http','demoService', function ($scope,$http,sampleService) {
console.log("in controller");
$scope.dataList = [];
$scope.itemsByPage = 5;
sampleService.getData().success(function(data){
$scope.dataList = data.objects;
console.log("data is" +$scope.dataList);
})
}]);