案例: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
<style>
7
table, th , td  {
8
  border: 1px solid grey;
9
  border-collapse: collapse;
10
  padding: 5px;
11
}
12
table tr:nth-child(odd) {
13
  background-color: #f1f1f1;
14
}
15
table tr:nth-child(even) {
16
  background-color: #ffffff;
17
}
18
</style>
19
</head>
20
<body>
21
22
<div ng-app="myApp" ng-controller="customersCtrl">
23
 
24
<table>
25
  <tr ng-repeat="x in names">
26
    <td>{{ x.Name }}</td>
27
    <td>{{ x.Country }}</td>
28
  </tr>
29
</table>
30
 
31
</div>
32
 
33
<script>
34
var app = angular.module('myApp', []);
35
app.controller('customersCtrl', function($scope, $http) {
36
   $http.get("/jsjq/angularjs/Customers_MySQL.php")
37
   .success(function (response) {$scope.names = response.records;});
38
});
39
</script>
40
41
</body>
42
</html>