我无法为我的Smart Table Angular 模块做一个简单的排序。我不应该只是能够添加st-sort="propertyName"
到我的th
吗?
JS:
var app = angular.module('app', []);
app.controller('SomeController', ['$scope', function($scope) {
$scope.items = [{color:'red'},{color:'blue'}];
}]);
html:
<html ng-app="app"><body ng-controller="SomeController">
<table st-table="items">
<thead>
<tr>
<th st-sort="color">Color</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in items">
<td>{{item.color}}</td>
</tr>
</tbody>
</table>
</body></html>
如果单击Colors
th
,则不会发生任何事情并且数据不会排序。我错过了什么?现场演示:http: //jsbin.com/ganine/2/edit