AngularJS Select(選擇框) 默認選中第一行
<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" } ];});
點擊查看更多內容
為 TA 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦