I am trying to sort the result table first by the user selected by the predicate and then by the predefined secondary.
For example, my ng-repeat is configured as follows:
<tr ng-repeat="line in model.resultList | orderBy:['-predicate', 'secondary_value'] | limitTo:model.pageSize:model.beginFrom">
... where the predicate is defined in the controller scope as $scope.predicate
, and there is logic that changes this name based on user options.
I can sort without problems, just using the predicate myself (for example, orderBy:predicate:reverse
)
Am I approaching this wrong? Are $ scope values allowed in the orderBy array?
source
share