我如何订购列表元素

时间:2014-01-17 10:21:22

标签: angularjs angularjs-select2

我正在通过使用ui-select2 =“”创建一个下拉列表,我如何将列表项排序到结果中

HTML:

<input  style="width:100%"  type="text" ui-select2="selectuiOptions"     
 data-placeholder="Select or Add Process/Ingredient">

JS:

    $scope.selectuiOptions = {
            data : $scope.processes,
}

我如何将list元素排序到结果

1 个答案:

答案 0 :(得分:0)

以下是示例:

function MyCtrl($scope, orderByFilter)

var isReverse = true,
    propertyName = 'myProperty';

$scope.selectuiOptions = {
   data : orderByFilter($scope.processes, 'propertyName', isReverse),
   ...
}
相关问题