案例:AngularJS案例     状态:可编辑再运行    进入横版
x
 
1
<!DOCTYPE html>
2
<html>
3
<meta charset="utf-8">
4
<script src="/js/angular.js1.4.6/angular.min.js"></script>
5
<body>
6
7
<div ng-app="myApp" ng-controller="sitesCtrl"> 
8
  <div ng-include="'/jsjq/angularjs/sites1.htm'"></div>
9
</div>
10
 
11
<script>
12
var app = angular.module('myApp', []);
13
app.controller('sitesCtrl', function($scope, $http) {
14
    $http.get("/jsjq/angularjs/sites2.htm").then(function (response) {
15
        $scope.names = response.data.records;
16
    });
17
});
18
</script>
19
20
<p>AngularJS 代码包含在 "sites.htm" 文件中。</p>
21
22
</body>
23
</html>

 运行结果 
 北美留学生论坛