案例:AngularJS案例     状态:可编辑再运行    进入横版
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<script src="/js/angular.js1.4.6/angular.min.js"></script>
6
</head>
7
<body>
8
9
<div ng-app="myApp" ng-controller="siteCtrl"> 
10
11
<ul>
12
  <li ng-repeat="x in names">
13
    {{ x.Name + ', ' + x.Country }}
14
  </li>
15
</ul>
16
17
</div>
18
19
<script>
20
var app = angular.module('myApp', []);
21
app.controller('siteCtrl', function($scope, $http) {
22
  $http.get("/jsjq/angularjs/sites.htm")
23
  .success(function (response) {$scope.names = response.sites;});
24
});

 运行结果 
 北美留学生论坛