title: Angular's orderBy filter and an array of object that has only methods
body: <p>I have an array of objects. The only exposed interface of these objects are their methods.</p>
  
  <pre><code>obj = { 
    getId : function() { ... },
    getName : function() { ... },
    getAvgHours : function() { ... }
  }
  </code></pre>
  
  <p>In fact, there are some fields that contain the actual values. But these are generated code so these fields are cryptically named, are buried under another layer of field. The access to their values should be done via supplied functions only.</p>
  
  <p>I'm looking for something like below, but it doesn't work:</p>
  
  <pre><code>&lt;tr ng-repeat="p in people | orderBy:p.getAvgHours()"&gt;
  </code></pre>
  
  <p>I could add a named <code>function getAvgHours(p) { return p.getAvgHours(); }</code> to the scope, which works. But it seems redundant, and I'd need to add a dozen of these functions.</p>
  
  <p>Is there any better way?</p>