Greetings, I have been utilizing this tag to modify my CSS style based on a condition where totalAsset and sortedAsset are equal.
<div class="table-row" ng-repeat="x in myData" ng-click="sort()"
ng-class="{'lightblue': x.totalAsset == sortedAsset}">
totalAsset contains the following data:
$scope.myData = [
{
totalAsset: "23557"
},
{
totalAsset: "4512190",
},
{
totalAsset: "2190",
},
{
totalAsset: "1256790",
}
]
I have created a function that automatically sorts the totalAsset values:
$scope.sort = function (){
$scope.unsortedAsset = $scope.myData.totalAsset;
$scope.sortedAsset=$scope.unsortedAsset.split("").sort().join("");
}
According to the logic, only the first and last rows will turn blue, while the other two will remain unchanged.