I am unable to do a simple sort for my Smart Table Angular module. Shouldn't I just be able to add st-sort="propertyName"
to my 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>
If you click the Colors
th
, nothing happens and the data does not sort. What am I missing? Live demo here: http://jsbin.com/ganine/2/edit