码迷,mamicode.com
首页 > Web开发 > 详细

AngularJS select

时间:2014-08-08 15:38:56      阅读:254      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   java   io   数据   for   ar   

 1 @{
 2     ViewBag.Title = "Index";
 3 }
 4 
 5 <script type="text/javascript">
 6     var myappModule = angular.module(myapp, []);
 7     myappModule.controller(selectCtr, function ($scope) {
 8         $scope.selectLst = [{ name: , value: 1 }, { name: , value: 2 }, { name: , value: 3 }];
 9         $scope.show = function () {
10             alert($scope.selected);
11         };
12     });
13 </script>
14 
15 <div ng-app="myapp" ng-controller="selectCtr">
16     <select ng-model="selected" ng-options="p.value as p.name for p in selectLst" ng-change="show()">
17         <option value="">选择下列数据</option>
18     </select>
19 </div>


获取selected的数据

AngularJS select,布布扣,bubuko.com

AngularJS select

标签:style   blog   color   java   io   数据   for   ar   

原文地址:http://www.cnblogs.com/dongbo19910728/p/3899273.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!