filter排序
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body ng-app="app" ng-controller="xmgController">
<p>{{score | orderBy:'' :true}}</p>
<hr>
<!--
第一个参数: 对哪个字段排序
第二个参数: true:降序, false:升序-->
<p>{{stu | orderBy:'age' : false}}</p>
</body>
<script src="js/angular.js"></script>
<script>
//1.创建模块
var app = angular.module('app', []);
//2.创建控制器
app.controller('xmgController', ['$scope', function ($scope) {
$scope.score = [55, 22, 44, 11, 33];
$scope.stu = [
{name:'zs', age:18},
{name:'ls', age:22},
{name:'yj', age:11},
{name:'sk', age:33}
];
}]);
//3.绑定模块 ng-app="app"
//4.绑定控制器 ng-controller="xmgController"
</script>
</html>