If it $scope.itemswas an array of objects (as implied $scope.items = []), you could use an angular orderBy filter :
<div ng-repeat="item in items | orderBy:'title'">
<span>{{item.title}}</span>
</div>
, items , , , ( ) "" , . javascript , - :
app.filter('orderObjectBy', function(){
return function(input, attribute) {
if (!angular.isObject(input)) return input;
var array = [];
for(var objectKey in input) {
array.push(input[objectKey]);
}
function compare(a,b) {
if (a[attribute] < b[attribute])
return -1;
if (a[attribute] > b[attribute])
return 1;
return 0;
}
array.sort(compare);
return array;
}
});
item:
<div ng-repeat="item in items | orderObjectBy:'title'">
<span>{{item.title}}</span>
</div>
fiddle, . @bennlich , , orderBy, .
, , " " Firebase .