title: Why does AngularJS `orderBy` filter ignore the `comparator` parameter?
body: <p>I am trying to order an array of objects by using a <code>comparator</code> function, but it seems the <code>comparator</code> function is completely ignored (See the <a href="https://docs.angularjs.org/api/ng/filter/orderBy">angular documentation</a>). </p>
  
  <p>I am using angularJS 1.5.6.</p>
  
  <p>Here is a <a href="https://jsfiddle.net/vxeosh8o/3/">JSFiddle</a></p>
  
  <p><strong>Html:</strong></p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.6/angular.min.js"&gt;
  &lt;/script&gt;
  &lt;body ng-app="app" ng-controller="ctrl"&gt;
      {{msg}}
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>JavaScript:</strong></p>
  
  <pre><code>angular.module("app", [])
  
  .factory('f1', function($filter) { 
  
      var f1 = {};
  
      function comparator(a,b) { console.log(a,b); return a.id - b.id; }
      function getter(x) { /*console.log(x);*/ return x; }
  
      f1.testOrderBy = function() {
          return $filter('orderBy')(
              [ {id:3}, {id:1}, {id:2} ], 
              getter, 
              false, 
              comparator
          )
          .map(function(x) { return x.id; })
      };
  
      return f1;
  })
  
  .controller("ctrl", function($scope, f1) {
      $scope.msg = f1.testOrderBy();
  })
  </code></pre>
  
  <p><strong>My question</strong>: Why is <code>comparator</code> ignored? (This can be seen since the <code>console.log()</code> call is never made). Is this an angularJS bug?</p>
  
  <p><em>Because of this I cannot even order an array of objects using a custom comparator.</em></p>
  
  <p>Thanks!</p>