SHARE
TWEET

Untitled

a guest Mar 20th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.directive('testSort', () => ({
  2.     scope: true,
  3.     link: (scope) => {
  4.         scope.items = [
  5.             {ranking: {nature: 1, computers: 2}},
  6.             {ranking: {nature: 2, computers: 1}},
  7.             {ranking: {nature: 3}},
  8.         ]
  9.     }
  10. }))
  11.  
  12. /*
  13. <test-sort>
  14.     <div ng-repeat="item in items | orderBy:'-ranking.nature'">
  15.         <pre>{{item | json}}</pre>
  16.     </div>
  17. </test-sort>
  18. */
RAW Paste Data
Top