demo.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AngularJS</title>
<script src="angular.min.js"></script> <!-- 引入AngularJS框架 -->
</head>
<body ng-app="App">
<div ng-controller="DemoController">
<ul>
<li ng-repeat="(key,star) in stars">第{{key+1}}个:{{star.name}} {{star.age}}</li> <!-- ng-repeat遍历数组 -->
</ul>
</div>
<script>
var App = angular.module('App',[]);
App.controller("DemoController",['$scope',function($scope) {
$scope.stars = [
{name:'刘德华',age:60},
{name:'周杰伦',age:50},
{name:'王力宏',age:40},
{name:'成龙',age:30}
];
}]);
</script>
</body>
</html>