国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

AngularJS select設置默認值的實現方法

2019-11-19 15:40:21
字體:
來源:轉載
供稿:網友

AngularJS的select設置默認值

在使用Angular時候使用select標簽時會遇到綁定數據指定默認顯示值可這樣實現

<!DOCTYPE html> <html ng-app="noteApp" ng-controller="noteCtrl"> <head>  <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="../plugins/angular.min.js"></script>  </head> <body ng-app="noteApp" ng-controller="noteCtrl">   <select ng-options="act.id as act.name for act in typeList"     ng-model="ZNoteVo.type"></select>  </body> <script type="text/javascript">   angular.module("noteApp", []).controller("noteCtrl", function($scope) {     $scope.typeList = [ {       id : '01',       name : "任務"     }, {       id : '02',       name : "日志"     }, {       id : '03',       name : "會議"     }, {       id : '04',       name : "學習"     }, {       id : '05',       name : "總結"     }, {       id : '99',       name : "其他"     } ];     $scope.ZNoteVo={};     $scope.ZNoteVo.type = "03";   }); </script> </html> 

當我們選擇類型是03時則默認是會議

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持,如有疑問請留言或者到本站社區交流討論,大家共同進步!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 嘉义市| 英超| 句容市| 苗栗市| 教育| 英山县| 诏安县| 即墨市| 拉孜县| 隆尧县| 安溪县| 卫辉市| 双辽市| 永春县| 淄博市| 南江县| 江达县| 易门县| 上蔡县| 元氏县| 攀枝花市| 镇雄县| 西吉县| 徐州市| 威信县| 新和县| 通河县| 蕲春县| 始兴县| 申扎县| 边坝县| 金川县| 连平县| 东兴市| 奈曼旗| 雷波县| 江都市| 修武县| 镇安县| 玉山县| 独山县|