title: bootstrap-angular.js comments sorting by order
body: <p>I want to display the comments in a specific order by typing date, author, and rating in the input section.They should also be able to sorted in descending order, for example, if -date is typed. I'm stuck.</p>
  
  <p><a href="http://i.stack.imgur.com/cJqc8.png" rel="nofollow">Comments sorting</a></p>
  
  <p>Here's my code.</p>
  
  <p></p>
  
  <pre><code>                &lt;ul class="list-unstyled" ng-repeat="comment in dishDetailCtrl.dish.comments | orderBy:dishDetailCtrl.sortBy"&gt;
                    &lt;li&gt;&lt;blockquote&gt;
                        &lt;h4&gt;{{comment.rating}} Stars&lt;/h4&gt;
                        &lt;h4&gt;{{comment.comment}}&lt;/h4&gt;
                        &lt;footer&gt;
                            {{comment.author}}, {{comment.date | date:mediumDate}}
                        &lt;/footer&gt;
                    &lt;/blockquote&gt;&lt;/li&gt;
                &lt;/ul&gt;
  
  &lt;script&gt;
  
      var app = angular.module('confusionApp',[]);
  
      app.controller('dishDetailController', function() {
  
          var dish={
                        name:'Uthapizza',
                        image: 'images/uthapizza.png',
                        category: 'mains', 
                        label:'Hot',
                        price:'4.99',
                        description:'A unique combination of Indian Uthappam (pancake) and Italian pizza, topped with Cerignola olives, ripe vine cherry tomatoes, Vidalia onion, Guntur chillies and Buffalo Paneer.',
                         comments: [
                             {
                                 rating:5,
                                 comment:"Imagine all the eatables, living in conFusion!",
                                 author:"John Lemon",
                                 date:"2012-10-16T17:57:28.556094Z"
                             },
                             {
                                 rating:4,
                                 comment:"Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
                                 author:"Paul McVites",
                                 date:"2014-09-05T17:57:28.556094Z"
                             },
                             {
                                 rating:3,
                                 comment:"Eat it, just eat it!",
                                 author:"Michael Jaikishan",
                                 date:"2015-02-13T17:57:28.556094Z"
                             },
                             {
                                 rating:4,
                                 comment:"Ultimate, Reaching for the stars!",
                                 author:"Ringo Starry",
                                 date:"2013-12-02T17:57:28.556094Z"
                             },
                             {
                                 rating:2,
                                 comment:"It's your birthday, we're gonna party!",
                                 author:"25 Cent",
                                 date:"2011-12-02T17:57:28.556094Z"
                             }
  
                         ]
                  };
  
          this.dish = dish;
  
      });
  &lt;/script&gt;
  </code></pre>