<! DOCTYPE html>
<meta http-equiv= "Content-type" content= "text/html; charset =utf-8 "/>
<meta http-equiv=" x-ua-compatible "content=" Ie=edge "/>
<meta name=" viewport "content=" Width=device-width,initial-scale=1 "/>
<!--[if Lt IE 9]>
<script src=" http://apps.bdimg.com/libs/ Html5shiv/3.7/html5shiv.min.js "></SCRIPT>
<script src=" http://apps.bdimg.com/libs/respond.js/ 1.4.2/respond.js "></SCRIPT>
<![ Endif]-->
<title></title>
<meta charset= "Utf-8"/>
<link rel= "stylesheet" href= " Bootstrap-3.3.5/dist/css/bootstrap.min.css "/>
<body>
<div class=" Container " Style= "padding:50px",
<div data-ng-app= "myApp" data-ng-controller= "Namesctrl";
<ul>
< Li data-ng-repeat= "x in Names";
{{x.name+ "" +x.age}}
</li>
</ul>
</div>
</ Div>
<script src= "Jquery/jquery-2.1.4.js" ></script>
<script src= "Bootstrap-3.3.5/dist/js/bootstrap.min.js" ></script>
<script src= "Http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js" ></script>
<script src= "Js/namesctrl.js" ></script>
</body>
The code in Namesctrl.js is as follows:
Angular.module ("myApp", []). Controller ("Namesctrl", function ($scope) {$scope. names = [{name: ' Zhangsan ', age:32}, {n Ame: ' Wangwu ', age:33}, {name: ' Zhaoliu ', age:32}]; });
AngularJS other instances of controllers in external files