Ответ 1
Вы можете заказать методом, так что вы можете использовать метод toString
<ul ng-repeat="strVal in arrVal | orderBy:'toString()' | filter:searchText">
Вот код, который не работает: Demo: http://jsfiddle.net/8dt94/63/
<div ng-controller="MyCtrl">
<input type="text" ng-model="searchText" />
<ul ng-repeat="strVal in arrVal|orderBy|filter:searchText" >
<li>{{strVal}}</li>
</ul>
</div>
var app=angular.module('myApp', []);
app.controller('MyCtrl', function ($scope,$filter) {
$scope.arrVal = ['one','two','three','four','five','six'];
});
Вы можете заказать методом, так что вы можете использовать метод toString
<ul ng-repeat="strVal in arrVal | orderBy:'toString()' | filter:searchText">
Напишите настраиваемый фильтр:
app.filter('mySort', function() {
return function(input) {
return input.sort();
}
});
HTML:
<ul ng-repeat="strVal in arrVal|filter:searchText|mySort">