标签: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
标签:style blog color java io 数据 for ar
原文地址:http://www.cnblogs.com/dongbo19910728/p/3899273.html