Skip to content

Commit

Permalink
Service List sort order correction (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
vibakar authored and asifdxtreme committed Oct 19, 2017
1 parent fa2904b commit 4ea4a43
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ angular.module('serviceCenter.sc', [])
'key': 'operation'
}
];

function predicateBy(prop){
return function(a,b){
if(a[prop] >b[prop]){
return 1;
}
else if(a[prop] < b[prop]){
return -1;
}
return 0;
}
}

$scope.refreshAppList = function() {
angular.element(document.querySelector('.fa-refresh')).addClass('fa-spin');
Expand Down Expand Up @@ -103,10 +115,12 @@ angular.module('serviceCenter.sc', [])

$scope.services.push(servicesList);
}


});

if($scope.services.length >0){
$scope.services.sort(predicateBy("serviceName"));
}

if($scope.services.length <= 0){
$scope.appList = 'empty';
}
Expand Down

0 comments on commit 4ea4a43

Please sign in to comment.