I have been trying to put a custom grid style and sorting icon in angular js and have succeded to do so far also except for the toggling of sorting icon
here is my html code of headers
<div ng-app="myApp">
<div ng-controller="TableCtrl">
<table class="MmTable">
<thead class="TblRow HeaderRow">
<tr>
<th class="TblHeader TblHeaderSortable SortIndex0 Column0" style="text-align: left;">
<i ng-click="sort('Subsidiary',$event)" class="SortDesc">
Subsidiary
<span class="{{Header[0]}}"></span>
</i>
</th></theah></table>
and here is sort function
$scope.sort = function (sortBy,event,element) {
$scope.resetAll();
$scope.columnToOrder = sortBy;
$scope.sortingOrder = 'asc';
//$(element).removeClass('SortDesc');
//$(element).addClass('SortAsc');
//$Filter - Standard Service
$scope.filteredList = $filter('orderBy')($scope.filteredList, $scope.columnToOrder, $scope.reverse);
if ($scope.reverse)
iconName = 'glyphicon glyphicon-chevron-up';
else
iconName = 'glyphicon glyphicon-chevron-down';
$(this).removeClass('SortDesc');
if ($(this).hasClass("SortDesc")) {
$(this).removeClass().addClass('SortAsc');
} else {
$(this).removeClass().addClass('SortDesc');
}
if (sortBy === 'Subsidiary') {
$scope.Header[0] = iconName;
}
else if (sortBy === 'name') {
$scope.Header[1] = iconName;
} else {
$scope.Header[2] = iconName;
}
$scope.reverse = !$scope.reverse;
$scope.pagination();
};
as, in above code i was trying to manipulate dom then found that cant do that in Angular. so,tried witg ng-style also but didn't work. Just needed a bit help in toggling of sorting icon as i want to put custom class for asc and desc sorting