var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope) {
  $scope.items = [{"title":"Action Comics","issue":"1","publisher":"DC Comics","cover_date":"1938-06-01","pedigree":"Church","grade_src":"Anecdote","grade":"9.2","general_commentary":"Best Existing","tags":"church,superman,action,dc,pedigree","sales":[],"uid":0},{"title":"Action Comics","publisher":"DC Comics","issue":"1","cover_date":"1938-04-01","pedigree":"","grade":"8.5","grade_src":"CGC","general_commentary":"Best Existing","tags":"cgc,action,superman","sales":[{"price":"1500000","sale_date":"2010-03-29","venue":"Comic Connect","link":"http://www.comicconnect.com/bookDetail.php?id=333815","$$hashKey":"00B"}],"uid":1},{"title":"Action Comics","issue":"1","publisher":"DC Comics","cover_date":"1938-04-01","pedigree":"Kansas City","grade_src":"CGC","grade":"8.0","tags":"action,superman,cgc,dc,pedigree","sales":[{"sale_date":"2010-02-22","price":"1000000","venue":"Comic Connect","link":"http://www.comicconnect.com/bookDetail.php?id=330734","$$hashKey":"00F"}],"uid":2},{"title":"Action Comics","issue":"1","publisher":"DC Comics","cover_date":"1938-04-01","grade":"7.5","grade_src":"CGC","sales":[{"sale_date":"2002-01-01","price":"192120.15","$$hashKey":"00J"}],"uid":3},{"title":"Action Comics","issue":"1","cover_date":"1938-04-01","pedigree":"Larson","grade_src":"Anecdote","grade":"VF","sales":[],"uid":4,"tags":"dc,pedigree,superman,action"},{"title":"Action Comics","issue":"1","publisher":"DC Comics","cover_date":"1938-04-01","grade_src":"Sotheby's Grading Commitee","grade":"78","tags":"action,superman,dc","sales":[{"sale_date":"1992-01-01","price":"82500","venue":"Sotheby's","$$hashKey":"00P"}],"uid":5},{"title":"Action Comics","issue":"1","publisher":"DC Comics","cover_date":"1938-04-01","grade_src":"CGC","grade":"6.5","tags":"cgc,superman,action","sales":[{"sale_date":"2006-01-01","price":"250000","$$hashKey":"00T"}],"uid":6},{"title":"Action Comics","issue":"1","publisher":"DC Comics","cover_date":"1938-04-01","grade_src":"CGC","grade":"9.0","tags":"cgc,superman,action","sales":[{"price":"2161000","link":"http://www.comicconnect.com/bookDetail.php?id=432101","sale_date":"2011-11-30","venue":"Comic Connect","$$hashKey":"00X"}],"uid":7},{"title":"Action Comics","issue":"1","publisher":"DC Comics","cover_date":"1938-04-01","grade_src":"CGC","grade":"6.5","general_commentary":"Upgraded from 5.5","tags":"cgc,upgrade,action,superman","sales":[{"sellers_notes":"as 5.5","sale_date":"1900-01-01","price":"120750","$$hashKey":"010"},{"sale_date":"2011-06-01","price":"625000","venue":"Comiclink","$$hashKey":"012"}],"uid":8},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"6.0","tags":"cgc,action,superman,dc","sales":[{"sale_date":"2010-03-13","price":"317200","venue":"Comic Connect","$$hashKey":"011"}],"uid":9},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"PGX","restoration":"Restored","grade":"9.0(r)","sales":[],"uid":10},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"5.0","tags":"action,superman,dc","sales":[{"sale_date":"2010-09-21","price":"436000","venue":"Comic Connect","$$hashKey":"01A"}],"uid":11},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"4.0","tags":"cgc,action,superman,dc","sales":[],"uid":12},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"4.5","tags":"cgc,superman,action,dc","sales":[{"sale_date":"1900-01-01","price":"86250","$$hashKey":"01B"},{"sale_date":"2011-08-09","price":"345000","venue":"Comic Connect","$$hashKey":"01D"}],"uid":13},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"4.0","tags":"cgc,action,superman,dc","sales":[],"uid":14},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"3.5","sales":[],"uid":15},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"3.0","tags":"cgc,superman,action,dc","sales":[{"sale_date":"2010-04-01","price":"300000","venue":"Comic Connect","$$hashKey":"01J"}],"uid":16},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"3.0","tags":"cgc,action,superman,dc","sales":[],"uid":17},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"3.0","tags":"cgc,action,superman,dc","sales":[],"uid":18},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"2.5","tags":"cgc,action,superman,dc","sales":[{"sale_date":"2009-06-19","price":"121000","venue":"Comic Connect","$$hashKey":"01Q"}],"uid":19},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"2.0","tags":"dc,cgc,superman,action","sales":[],"uid":20},{"title":"Action Comics","issue":"1","publisher":"DC Comics","grade_src":"CGC","grade":"8.5(mp)","restoration":"Moderate Professional","tags":"cgc,restored,superman,action","sales":[{"sale_date":"2008-05-01","price":"116512","venue":"Heritage","$$hashKey":"01V"}],"uid":21},{"cgcid":"","title":"Action Comics","issue":"2","publisher":"DC Comics","pedigree":"Church","grade_src":"","sales":[],"uid":22,"tags":"action,superman,pedigree,dc"},{"title":"Action Comics","issue":"7","publisher":"DC Comics","pedigree":"Church","tags":"dc,pedigree,superman,action","sales":[],"uid":23},{"title":"Action Comics","issue":"7","grade_src":"CGC","grade":"8.0","sales":[{"sale_date":"2008-02-01","price":"143400","venue":"Heritage","$$hashKey":"023"}],"uid":24},{"title":"Amazing Spider-Man","issue":"1","pedigree":"Curator","grade_src":"CGC","grade":"9.6","tags":"marvel,spider-man,cgc","sales":[],"uid":25},{"title":"Action Comics","issue":"10","grade_src":"CGC","grade":"9.0","tags":"cgc,superman,dc,action","sales":[{"sale_date":"2011-08-09","price":"258000","venue":"Comic Connect","$$hashKey":"027"}],"uid":26},{"title":"Action Comics","issue":"13","publisher":"DC Comics","grade_src":"cgc","grade":"9.2","tags":"cgc,action,superman,dc","sales":[{"sale_date":"2011-08-09","price":"185000","venue":"Comic Connect","$$hashKey":"02C"}],"uid":27},{"title":"All American Comics","issue":"16","pedigree":"Church","grade_src":"CGC","grade":"9.4","tags":"all-american-comics,green-lantern,dc,cgc,pedigree","sales":[{"sale_date":"1984-01-01","price":"9000","$$hashKey":"02H"}],"uid":28},{"title":"All American Comics","issue":"16","publisher":"DC Comics","pedigree":"Reilly","grade_src":"Anecdote","grade":"9+","grading_notes":"qualified, coupon out of back cover","tags":"all-american-comics,green-lantern,dc,pedigree","sales":[{"sellers_notes":"OS26 listing","sale_date":"1996-01-01","price":"60000","$$hashKey":"02K"}],"uid":29},{"title":"All Star Comics","issue":"3","publisher":"DC Comics","pedigree":"Church","grade_src":"CGC","grade":"9.6","tags":"all-star-comics,jsa,dc,pedigree,cgc","sales":[{"sale_date":"1901-01-01","price":"126500","$$hashKey":"04W"}],"uid":30},{"title":"All Star Comics","issue":"8","pedigree":"Church","grade_src":"","general_commentary":"Overstreet 26 reported sale","tags":"all-star dc church pedigree","sales":[{"sale_date":"1995-01-01","price":"70000","$$hashKey":"02R"}],"uid":31},{"title":"All Winners Comics","issue":"1","pedigree":"Chicago","grade_src":"CGC","grade":"9.6","tags":"all-winners timely marvel","sales":[{"link":"http://www.hakes.com/item.asp?Auction=188&ItemNo=44415","sale_date":"2006-06-29","price":"95200","venue":"Hakes","$$hashKey":"02X"}],"uid":32},{"title":"Amazing Fantasy","issue":"15","grade_src":"CGC","grade":"9.6","general_commentary":"Best Known","tags":"marvel spider-man","sales":[{"sale_date":"2011-03-09","price":"1100000","venue":"Comic Connect","link":"http://www.comicconnect.com/load_page.php?page=amazing_fantasy_15","$$hashKey":"032"}],"uid":33},{"title":"Amazing Fantasy","issue":"15","pedigree":"White Mountain","grade_src":"cgc","grade":"9.4","tags":"spider-man heritage cgc","sales":[{"sale_date":"1993-01-01","price":"39100","venue":"Sothebys","$$hashKey":"034"},{"link":"http://comics.ha.com/c/item.zx?saleNo=816&lotNo=5272","price":"126500","sale_date":"2005-05-20","venue":"Heritage","$$hashKey":"036"},{"sale_date":"2004-08-01","price":"150000","venue":"Pedigree","link":"http://www.pedigreecomics.com/detail.php?issue_id=719","$$hashKey":"038"},{"sale_date":"2007-10-16","price":"227000","link":"http://www.comiclink.com/auctions/item.asp?back=%2FComicTrack%2FAdmin%2Fauction%2Easp%3FImage1%2Ex%3D0%26Image1%2Ey%3D0%26SearchTitle%3Damazing%26SearchIssueNumber%3D15%26SearchSeller%3D%26SearchHighBidder%3D%26Image1%2Ex%3D0%26Image1%2Ey%3D0&id=715469&next=%2FComicTrack%2FAdmin%2Fauction%2Easp%3FImage1%2Ex%3D0%26Image1%2Ey%3D0%26SearchTitle%3Damazing%26SearchIssueNumber%3D15%26SearchSeller%3D%26SearchHighBidder%3D%26Image1%2Ex%3D0%26Image1%2Ey%3D0","venue":"Comiclink","$$hashKey":"03A"}],"uid":34},{"title":"Amazing Fantasy","issue":"15","grade_src":"CGC","grade":"9.4","tags":"amazing-fanasy spider-man cgc","sales":[{"sale_date":"2003-05-07","price":"86250","venue":"Heritage","link":"http://comics.ha.com/c/item.zx?saleNo=806&lotNo=5073","$$hashKey":"03A"},{"sale_date":"2005-01-01","price":"145000","venue":"PGCMint","$$hashKey":"03C"},{"sale_date":"2007-01-01","price":"210000","venue":"ComicLink","link":"http://www.comiclink.com/itemdetail.asp?id=706615&next=%2FComicTrack%2FAdmin%2FCL%2Fmatches%2Easp%3FTITLE%3DAMAZING%2BFANTASY%26ISSUENUMBER%3D15%26ORDERNUMBER%3D%26SELLER%3D%26BUYER%3D%26PEDIGREE%3D%26CGCCOMMENT%3D%26SELLERCOMMENT%3D%26TYPE%3D0%26FILTER%3D%26Payment%3D%26Verified%3D%26Shipped%3D%26SPBP%3D","$$hashKey":"03E"}],"uid":35},{"title":"Amazing Fantasy","issue":"15","pedigree":"Diamond Run","grade_src":"CGC","grade":"9.4","tags":"amazing-fantasy cgc pedigree","sales":[{"sale_date":"2001-01-01","price":"86000","$$hashKey":"03J"},{"sale_date":"2004-01-01","price":"122000","venue":"ComicLink","$$hashKey":"03L"}],"uid":36},{"title":"Amazing Fantasy","issue":"15","grade_src":"CGC","grade":"9.4","tags":"cgc amazing-fantasy spider-man","sales":[],"uid":37},{"title":"Amazing Fantasy","issue":"15","grade_src":"CGC","grade":"9.4","tags":"spider-man cgc amazing-fantasy","sales":[],"uid":38},{"title":"Amazing Fantasy","grade":"9.4","grade_src":"CGC","issue":"15","tags":"spider-man cgc amazing-fantasy","sales":[],"uid":39},{"title":"Amazing Fantasy","issue":"15","grade_src":"CGC","grade":"9.2","tags":"spider-man cgc amazing-fantasy","sales":[],"uid":40}]
});
<!DOCTYPE html>
<html data-ng-app="plunker">

  <head>
    <meta charset="utf-8" />
    <title>orderby demo for htmlcssjavascript.com/javascript/sorting-by-multiple-fields-with-different-sort-orders-using-the-angularjs-orderby-filter/</title>
    <script>document.write('<base href="' + document.location + '" />');</script>
    <link rel="stylesheet" href="style.css" />
    <script data-require="angular.js@1.0.x" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js" data-semver="1.0.7"></script>
    <script src="app.js"></script>
  </head>

  <body data-ng-controller="MainCtrl">
 <table>
    <tr>
      <th>title</th>
      <th>issue#</th>
      <th>pedigree</th>
      <th>grade_src</th>
      <th>grade</th>
      <th>general_commentary</th>
      <th>sales</th>
    </tr>  
    <tr data-ng-repeat="it in items | orderBy:['title','issue','-grade']">
      <td>{{it.title}}</td>
      <td>{{it.issue}}</td>
      <td>{{it.pedigree}}{{it.collection}}{{it.provenance}}</td>
      <td>{{it.grade_src}}</td>
      <td>{{it.grade}}</td>
      <td>{{it.general_commentary}}</td>
      <td class="sales">
        <table>
          <tr data-ng-repeat="sl in it.sales | orderBy: 'sale_date'">
            
            <td>{{sl.venue}}</td>
            <td>{{sl.sale_date}}</td>
            <td data-ng-show="sl.link"><a href="{{sl.link}}">{{sl.price | currency}}</a></td>
            <td data-ng-hide="sl.link">{{sl.price | currency}}</td>
            <td>
          </tr>
        </table>  
      </td>
    </tr>
  </table>  
        
  
</script>


  </body>

</html>
/* Put your css in here */

table {
  margin: .5em 0 1em;
}

table th {
  text-align: left;
  border: 1px solid #d1d1d1;
  padding: .4em .8em;
  font-weight: bold;
}

table td {
  background-color: #fff;
  border: 1px solid #d1d1d1;
  padding: 10px;
}