实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<script src="https://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js"></script>
4
<body>
5
6
<div ng-app="myApp" ng-controller="customersCtrl"> 
7
8
<ul>
9
  <li ng-repeat="x in names">
10
    {{ x.Name + ', ' + x.Country }}
11
  </li>
12
</ul>
13
14
</div>
15
16
<script>
17
var app = angular.module('myApp', []);
18
app.controller('customersCtrl', function($scope, $http) {
19
  $http.get("/static/example/Customers_JSON.php")
20
  .success(function (response) {$scope.names = response.records;});
21
});
22
</script>
23
24
</body>
25
</html>
26