I have a JSON where the version number corresponds to string which are manually inserted in the html. The JSON example:
Object $$hashKey : "007"
tenant : "A. Edition"
uri :"1101403"
version : "4"
In the html:
<th ng-click="sortData('version')">
Version
</th>
<tr ng-repeat="t in tenants | orderBy:sortColumn:reverseSort" >
<td>
<span ng-if="t.version==1" >Business Edition</span>
<span ng-if="t.version==2" >Non-business Edition</span>
<span ng-if="t.version==3" >Bank Edition</span>
.......
</td>
Sort function:
$scope.sortData = function (column) {
$scope.reverseSort = ($scope.sortColumn == column) ?!$scope.reverseSort: false;
$scope.sortColumn = column;
}
I want to sort with the strings (Business Edition, Non-business Edition etc.) instead of t.version. How do I easily do that (new to angular)? Thanks for your help.