I need one help.I need to sort the table row value as per one column which contains some number type value using Angular.js. I am explaining my code below.
<tr ng-repeat="c in clickSummary">
sl no name page hit map hit gallery hit web hit total
1 aaa 1 1 0 1 3
2 bbb 2 2 1 0 5
3 ccc 1 2 3 0 6
4 ddd 1 3 0 0 4
5 eee 2 4 1 2 9
<tr ng-repeat="c in clickSummary | orderBy:['-total','+rest_name'] ">
Here is a live demo
Orders a specified array by the expression predicate. It is ordered alphabetically for strings and numerically for numbers. Note: if you notice numbers are not being sorted as expected, make sure they are actually being saved as numbers and not strings. Array-like values (e.g. NodeLists, jQuery objects, TypedArrays, Strings, etc) are also supported.