Anjularjs provides few filters for format data like number,date format, number of decimals,custom currency format...ect. as well using same filter syntax we can sort the data as well.
Example :
{{ Orderby_expression | Orderyby : Expression : (asc/desc) }}
[ asc/desc(defult) is optional ]
ng-repeat="e in employees | orderBy :'Salary'"
[OR]
ng-repeat="e in employees | orderBy :'Salary':false"
[OR]
ng-repeat="e in employees | orderBy :'+Salary'" (asc--0-100)
Bydefault items ascending order(default--"false"),if we need rows sorted in descending order specify as "true".
if need sort the data based on any one of the column then.
output :
No comments:
Post a Comment