title: How to orderBy a array of objects in descending order in angularjs?
body: <p>I have a very simple array of objects and I want to sort it using <code>$filter('orderBy')</code> in javascript. Somehow it doesn't seem to work. <a href="https://jsfiddle.net/saras_arya/1bcmo74j/" rel="noreferrer">jsFiddle</a> </p>
  
  <p>Here is the code</p>
  
  <pre><code>var app = angular.module('myApp', []);
  
  app.controller('myController', function($scope, $filter){
      var person = [{
    name : "Saras"
    },
    {
    name : "Arya"
    }];
    $filter('orderBy')(person, 'name');
    console.log(person);
  });
  </code></pre>
  
  <p>I don't understand why I can't get this to work? Help is appreciated. And the solution should be in JS not in HTML. </p>