【发布时间】:2015-02-27 19:22:24
【问题描述】:
我无法对我的Smart Table Angular module 进行简单排序。我不应该可以将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>
如果您单击Colorsth,则不会发生任何事情并且数据不会排序。我错过了什么?现场演示:http://jsbin.com/ganine/2/edit
【问题讨论】:
标签: angularjs smart-table