标签:css logs app ras bootstrap params function span func
需要的文件:
注入依赖:
var app = angular.module(‘app‘, [ ‘ngTable‘, ‘ui.bootstrap‘, ]);
为ng-table设置数据
app.controller(‘controller‘, function($scope,NgTableParams) { $http.get("/query") .success(function(data) { $scope.userTable = new NgTableParams({ page : 1, count : 5 }, { total : data.length, getData : data } }); }) }); }
为 table 添加 ng-table 属性
<table ng-table="userTable" class="table table-hover"> <tbody> <tr> <th>编号</th> <th>用户名</th> </tr> <tr ng-repeat="user in $data"> <td>{{user.id}}</td> <td>{{user.name}}</td> </tr> </tbody> </table>
标签:css logs app ras bootstrap params function span func
原文地址:http://www.cnblogs.com/avidya/p/7646708.html