title: orderBy not working with customOrder in angular js
body: <p>On view page, I have used filter like this :</p>
  
  <blockquote>
  <pre><code> &lt;div class="col-md-3" ng-repeat="product in vendorProducts.offers | orderBy:customOrder" ng-if="vendorProducts.offers.length &gt; 0"&gt;
  </code></pre>
  </blockquote>
  
  <p>In controller, I have created custom filter :</p>
  
  <pre><code> $scope.customOrder = function (item) {
      var filtered = [];
  
      angular.forEach($scope.cRoomProducts, function(cRoomProduct) {
        var vproduct = _.find($scope.vendorProducts.offers,function(vp){ return vp._id == cRoomProduct.offerDetails[0]._id })
        filtered.push(vproduct)
      });
  
      var remainOfferProduct = $scope.vendorProducts.offers.filter(function(x) { return filtered.indexOf(x) &lt; 0 })
      filtered = filtered.concat(remainOfferProduct)
      return filtered;
       };
  </code></pre>
  
  <p>getting array in <strong>filtered</strong> but still data is not sorted.
  Any help on this highly appreciated.</p>
  
  <p>I have two arrays. I want to sort data by using data of first array comes first. $scope.cRoomProducts data comes first So, I have filtered data accordingly. and want to sort data of vendorProducts.offers . </p>