案例: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
.striped {
8
    color:white;
9
    background-color:black;
10
}
11
</style>
12
</head>
13
<body ng-app="myApp">
14
15
<table ng-controller="myCtrl">
16
<tr ng-repeat="x in records" ng-class-odd="'striped'">
17
  <td>{{x.Name}}</td>
18
  <td>{{x.Country}}</td>
19
</tr>
20
</table>
21
22
<script>
23
var app = angular.module("myApp", []);
24
app.controller("myCtrl", function($scope) {
25
  $scope.records = [
26
    {
27
      "Name" : "Alfreds Futterkiste",
28
      "Country" : "Germany"
29
    },
30
    {
31
      "Name" : "Berglunds snabbk",
32
      "Country" : "Sweden"
33
    },
34
    {
35
      "Name" : "Centro comercial Moctezuma",
36
      "Country" : "Mexico"
37
    },
38
    {
39
      "Name" : "Ernst Handel",
40
      "Country" : "Austria"
41
    }
42
  ]
43
});
44
</script>
45
46
</body>
47
</html>
48