Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
  <div ng-controller="ctrl">
    This list is sorted:
    <p ng-repeat="item in itemObjects | orderBy:'value'">{{item.value}}</p>
    
    <br><br>
    
    I want this list sorted too:
    <p ng-repeat="item in items">{{item}}</p>
  </div>
  
</body>
</html>
 
function ctrl($scope) {
 $scope.items = [7,3,8,2,1,9]; 
  
  $scope.itemObjects = [
    {value:7},
    {value:4},
    {value:5},
    {value:7},
    {value:8},
    {value:1}
   ];
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers