答案 0 :(得分:2)
如果要动态更改orderBy,请使用以下内容:
<div ng-repeat="post in posts | filter:filters | orderBy:orderBy">
在您的代码中:
$scope.orderBy = 'count'; // Use 'count' as default value
$scope.changeOrder = function(prop) {
$scope.orderBy = prop;
}
点击后动态更改:
<a ng-click="changeOrder('yourProperty')">Reorder By yourProperty</a>