Making use of AngularJS orderBy filter I've created a sortable table here,
http://plnkr.co/edit/AarOSuawXVYe9C5LBDOK?p=preview
I am using the value of 'reverse' for each table header on click to determine the direction of the sort. This creates an obvious problem however as I click on different table headers they simply go to the opposite of the reverse value which may have previously been changed from another table header.
<th ng-click="predicate = 'character'; reverse=!reverse">alpha</th>
<th ng-click="predicate = 'num'; reverse=!reverse">num</th>
<th ng-click="predicate = 'dec'; reverse=!reverse">dec</th>
<th ng-click="predicate = 'value'; reverse=!reverse"></th>
<th ng-click="predicate = 'date'; reverse=!reverse">date</th>
and the ng-repeat populating my table rows using the orderBy filter
<tr ng-repeat="line in infoCtrl.data | orderBy:predicate:reverse">
How can I isolate the scope of reverse, or give them an individual reverse value each?