实例代码“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
<table>
9
  <tr ng-repeat="x in names">
10
    <td>{{ x.Name }}</td>
11
    <td>{{ x.Country }}</td>
12
  </tr>
13
</table>
14
15
</div>
16
17
<script>
18
var app = angular.module('myApp', []);
19
app.controller('customersCtrl', function($scope, $http) {
20
    $http.get("/static/example/Customers_JSON.php")
21
    .success(function (response) {$scope.names = response.records;});
22
});
23
</script>
24
25
</body>
26
</html>
27