国产探花免费观看_亚洲丰满少妇自慰呻吟_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時則默認是會議

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 和龙市| 尼勒克县| 富裕县| 松溪县| 遂宁市| 永泰县| 英吉沙县| 新巴尔虎右旗| 安远县| 白河县| 南澳县| 靖远县| 六安市| 云梦县| 西平县| 青川县| 镇康县| 汕尾市| 临朐县| 鹤岗市| 泸水县| 光山县| 禹城市| 怀来县| 景德镇市| 南宁市| 黄骅市| 平阳县| 古蔺县| 大宁县| 桦川县| 珠海市| 武山县| 罗平县| 东城区| 汉沽区| 嘉兴市| 十堰市| 黄陵县| 武义县| 临武县|