Answer the question
In order to leave comments, you need to log in
Sorting orderBy on a simple array of values?
It would seem a simple task, but everywhere in the examples sorting an array of objects.
I need to sort a simple array of values. Here is an example:
function TodoCtrl($scope) {
$scope.todos = [ 3, 5, 1, 8, 2 ]; // Простые числа
}
<div ng-app>
<div ng-controller="TodoCtrl">
<div ng-repeat="item in todos | orderBy: item"> /* Как отсортировать числа ? */
<p> {{item}} </p>
</div>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question