<div ng-app="myApp" ng-controller="myCtrl"><select ng-init="selectUrl = sites[0].url" ng-model="selectUrl"><option ng-repeat="site in sites" value="{{site.url}}">{{site.site}}</option></select><h1>{{selectUrl}}</h1></div>
var app = angular.module('myApp', []);app.controller('myCtrl', function($scope) { $scope.sites = [ { site : "Google", url : "http://www.google.com" }, { site : "Runoob", url : "https://www.runoob.com" }, { site : "Taobao", url : "http://www.taobao.com" } ];});
https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js
打开App,阅读手记