title: Error: [orderBy:notarray] Expected array but received: {}
body: <p>I am trying to implement pagination functionality from here:
  <a href="http://jsfiddle.net/SAWsA/11/" rel="nofollow noreferrer">http://jsfiddle.net/SAWsA/11/</a></p>
  
  <pre><code>[
    {
      "name": "Micro biology",
      "id": "2747c7ecdbf85700bde15901cf961998",
      "category": "Other",
      "type": "Mandatory - No Certification",
      "categoryid": "808ff269db7cd700bde15901cf9619f3"
    },
    {
      "name": "Java Fundamentals",
      "id": "5475f2a0dbf85700bde15901cf961964",
      "category": "IT",
      "type": "Mandatory - No Certification",
      "categoryid": "2b5e7e29db7cd700bde15901cf961917"
    }
  ]
  </code></pre>
  
  <p>I have an object like shown above.</p>
  
  <p>When I <strong>ng-repeat</strong> </p>
  
  <p><code>&lt;tr ng-repeat="skillTestsData in data.skillTests[currentPage] | orderBy:sortingOrder:reverse"&gt;</code></p>
  
  <p>I am getting below error:</p>
  
  <blockquote>
    <p>Error: [orderBy:notarray] Expected array but received: {"name":"Micro biology","id":"2747c7ecdbf85700bde15901cf961998","category":"Other","type":"Mandatory - No Certification","categoryid":"808ff269db7cd700bde15901cf9619f3"}</p>
  </blockquote>
  
  <p><strong>Here is my HTML:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var sortingOrder = 'name';
  &lt;/script&gt;
  
  &lt;tr ng-repeat="skillTestsData in data.skillTests[currentPage] | orderBy:sortingOrder:reverse"&gt; ------- &lt;/tr&gt;
  </code></pre>
  
  <p><strong>Here is my Client script:</strong></p>
  
  <pre><code>function($scope, $filter) {
    c.data.skillTests //which has my object
  
  /*Pagination starts here new one */
  
  // init
  $scope.sortingOrder = sortingOrder;
  $scope.reverse = false;
  $scope.filteredItems = [];
  $scope.groupedItems = [];
  $scope.itemsPerPage = 5;
  $scope.pagedItems = [];
  $scope.currentPage = 0;
  
  
  //$scope.items = [];
  $scope.items = c.data.skillTests;
  //serach and initialize start
  var searchMatch = function (haystack, needle) {
      if (!needle) {
          return true;
      }
      return haystack.toLowerCase().indexOf(needle.toLowerCase()) !== -1;
  };
  // init the filtered items
  $scope.search = function () {
      $scope.filteredItems = $filter('filter')($scope.items, function (item) {
          for(var attr in item) {
              if (searchMatch(item[attr], $scope.query))
              return true;
          }
          return false;
      });
      // take care of the sorting order
      if ($scope.sortingOrder !== '') {
          $scope.filteredItems = $filter('orderBy')($scope.filteredItems, $scope.sortingOrder, $scope.reverse);
      }
      $scope.currentPage = 0;
      // now group by pages
      $scope.groupToPages();
  };
  //serach and initialize end
  
  // calculate page in place
  $scope.groupToPages = function () {
      $scope.pagedItems = [];
      for (var i = 0; i &lt; $scope.filteredItems.length; i++) {
          if (i % $scope.itemsPerPage === 0) {
              $scope.pagedItems[Math.floor(i / $scope.itemsPerPage)] = [ $scope.filteredItems[i] ];
              } else {
              $scope.pagedItems[Math.floor(i / $scope.itemsPerPage)].push($scope.filteredItems[i]);
          }
      }
  };
  $scope.range = function (start, end) {
      var ret = [];
      if (!end) {
          end = start;
          start = 0;
      }
      for (var i = start; i &lt; end; i++) {
          ret.push(i);
      }
      return ret;
  };
  $scope.prevPage = function () {
      if ($scope.currentPage &gt; 0) {
          $scope.currentPage--;
      }
  };
  $scope.nextPage = function () {
      if ($scope.currentPage &lt; $scope.pagedItems.length - 1) {
          $scope.currentPage++;
      }
  };
  $scope.setPage = function () {
      $scope.currentPage = this.n;
  };
  // functions have been describe process the data for display
  $scope.search();
  // change sorting order
  $scope.sort_by = function(newSortingOrder) {
      if ($scope.sortingOrder == newSortingOrder)
      $scope.reverse = !$scope.reverse;
      $scope.sortingOrder = newSortingOrder;
      // icon setup
      $('th i').each(function(){
          // icon reset
          $(this).removeClass().addClass('icon-sort');
      });
      if ($scope.reverse)
      $('th.'+new_sorting_order+' i').removeClass().addClass('icon-chevron-up');
      else
      $('th.'+new_sorting_order+' i').removeClass().addClass('icon-chevron-down');
  };
  /*Pagination ends here new one */
  
  
  }
  </code></pre>