0
我有一個簡單的程序來訂購按「年齡」列表。但它不工作,給錯誤!請幫助。簡單的orderBy過濾器不能在AngularJs中工作
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js" ></script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
See here: <p ng-repeat="x in persons | orderby: age">{{x.name}},{{x.age}}</p>
<script>
//module declaration
var app = angular.module("myApp",[]);
//controller declaration
app.controller('myCtrl',function($scope){
$scope.persons=[
{name:"Peter",age:23},{name:"Lina",age:36},{name:"Robert",age:31}
];
});
</script>
</body>
</html>
什麼樣的錯誤你得到 –