title: AngularJS - how to get first item in ng-repeat orderby:'title'
body: <p>I'd like to know how to get the first item's data after changing the order in ng-repeat.</p>
  
  <p>I have created the jsfiddle which loads first item of the data.
  I'd like get first item after orderBy title.</p>
  
  <p><a href="http://jsfiddle.net/xTJr3/1/" rel="nofollow">http://jsfiddle.net/xTJr3/1/</a></p>
  
  <pre><code>&lt;div ng-controller="AppCtrl"&gt;
      &lt;div data-items&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  angular.module('App', []).
  // sample data
  controller('AppCtrl', function($scope){
      $scope.items =[
          {'title': 'Item 3'},
          {'title': 'Item 2'},
          {'title': 'Item 1'}
      ]
  }).
  directive('items', function(){
      return {
          template: '&lt;span ng-repeat="item in items | orderBy:\'title\'"&gt;{{item.title}}&lt;/span&gt;'+
          '&lt;h1&gt;{{currentItem}}&lt;/h1&gt;',
          controller: function($scope){
              // wants to get first item's title after ordered by title.
              // it should be Item 1
              $scope.currentItem = $scope.items[0].title;
          }
      }
  })
  </code></pre>