I have a simple program to orderBy the lists by "age". But its not working and giving error! Pls help.
<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>