相关疑难解决方法(0)

smart-table Angular模块无法排序

我无法对我的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'}];
}]);
Run Code Online (Sandbox Code Playgroud)

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>
Run Code Online (Sandbox Code Playgroud)

如果单击Colors th,则没有任何反应,数据也不会排序.我错过了什么?现场演示:http://jsbin.com/ganine/2/edit

angularjs smart-table

2
推荐指数
1
解决办法
5166
查看次数

标签 统计

angularjs ×1

smart-table ×1