<!DOCTYPE html>
<html ng-app="App">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body ng-controller="Democtrl">
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
var App = angular.module("App",[]);
App.controller("Democtrl",function($scope){
$scope.arrs = [{"age": 20,"id": 10,"name": "iphone"},
{"age": 12,"id": 11,"name": "sunm xing"},
{"age": 44,"id": 12,"name": "test abc"}
]
});
</script>
<!--//orderBy对数组进行排序的工作,大小的默认的是从小到大的排,给true,是从大到小的排
如果字母进行排序的放是从a-z这个顺序排的,z-a
//-->
<!--<p>{{arrs | orderBy:"age":"true"}}</p>-->
<p>{{arrs | orderBy:"name":"true"}}</p>
<html ng-app="App">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body ng-controller="Democtrl">
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
var App = angular.module("App",[]);
App.controller("Democtrl",function($scope){
$scope.arrs = [{"age": 20,"id": 10,"name": "iphone"},
{"age": 12,"id": 11,"name": "sunm xing"},
{"age": 44,"id": 12,"name": "test abc"}
]
});
</script>
<!--//orderBy对数组进行排序的工作,大小的默认的是从小到大的排,给true,是从大到小的排
如果字母进行排序的放是从a-z这个顺序排的,z-a
//-->
<!--<p>{{arrs | orderBy:"age":"true"}}</p>-->
<p>{{arrs | orderBy:"name":"true"}}</p>
</body>
</html>
</html>