案例: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="myCtrl">
10
11
<p>选择网站:</p>
12
13
<select ng-model="selectedSite">
14
<option ng-repeat="x in sites" value="{{x.url}}">{{x.site}}</option>
15
</select>
16
17
<h1>你选择的是: {{selectedSite}}</h1>
18
19
</div>
20
21
<script>
22
var app = angular.module('myApp', []);
23
app.controller('myCtrl', function($scope) {
24
   $scope.sites = [
25
        {site : "Google", url : "http://www.google.com"},
26
        {site : "W3xue", url : "https://www.w3xue.com"},
27
        {site : "Taobao", url : "http://www.taobao.com"}
28
    ];
29
});
30
</script>
31
32
<p>该实例演示了使用 ng-repeat 指令来创建下拉列表,选中的值是一个字符串。</p>
33
</body>
34
</html>
35