智能表角模块无法排序 [英] smart-table Angular module unable to sort
本文介绍了智能表角模块无法排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不能做我的智能表角模块一个简单的排序。我不应该只是能够添加 ST排序=PROPERTYNAME
我的个
?
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>
如果您点击颜色
个
,什么都不会发生,数据不排序。我在想什么?在这里现场演示: http://jsbin.com/ganine/2/edit
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
推荐答案
您应该添加智能表
模块依赖于你应用
模块是这样的:
You should add a smart-table
module dependency to you app
module like this:
var app = angular.module('app', ['smart-table']);
请参阅例如。
这篇关于智能表角模块无法排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文