无法在 angularJS 中使用智能 Table 进行排序
Not able to sort using Smart Table in angularJS
我正在使用智能 table 但我无法对 table 进行排序,以下是我的代码
<div ng-app="app">
<div ng-controller="app-controller">
<table st-table="EmployeeDetails" class="table table-striped table-hover" st-safe-src="EmployeeData">
<thead>
<tr>
<th st-sort="EmployeeName">Employee Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="employee in EmployeeData">
<td class="col-xs-2">
<small>{{employee.EmployeeName}}</small>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<script type="text/javascript">
var app = angular.module('app', []);
app.controller('app-controller', ['$scope','$http', function ($scope,$http) {
$http.get('/Data/EmployeeDetails.json').success(function (data) {
$scope.EmployeeData = data;
}).error(function () {
alert('error');
});
}]);
</script>
谁能告诉我到底出了什么问题,我已经参考了 angular.js 和 smart-table.js
<script src="../Scripts/angular.js"></script>
<script src="../Scripts/smart-table.js"></script>
您应该在 ng-repeat
使用 'EmployeeDetails'
JSFiddle
好的
<tr ng-repeat="employee in EmployeeDetails">
错误
<tr ng-repeat="employee in EmployeeData">
谢谢
我正在使用智能 table 但我无法对 table 进行排序,以下是我的代码
<div ng-app="app">
<div ng-controller="app-controller">
<table st-table="EmployeeDetails" class="table table-striped table-hover" st-safe-src="EmployeeData">
<thead>
<tr>
<th st-sort="EmployeeName">Employee Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="employee in EmployeeData">
<td class="col-xs-2">
<small>{{employee.EmployeeName}}</small>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<script type="text/javascript">
var app = angular.module('app', []);
app.controller('app-controller', ['$scope','$http', function ($scope,$http) {
$http.get('/Data/EmployeeDetails.json').success(function (data) {
$scope.EmployeeData = data;
}).error(function () {
alert('error');
});
}]);
</script>
谁能告诉我到底出了什么问题,我已经参考了 angular.js 和 smart-table.js
<script src="../Scripts/angular.js"></script>
<script src="../Scripts/smart-table.js"></script>
您应该在 ng-repeat
使用 'EmployeeDetails'
JSFiddle
好的
<tr ng-repeat="employee in EmployeeDetails">
错误
<tr ng-repeat="employee in EmployeeData">
谢谢