最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

AngularJS select設(shè)置默認(rèn)值的實(shí)現(xiàn)方法

 更新時(shí)間:2017年08月25日 15:55:54   投稿:lqh  
這篇文章主要介紹了AngularJS select設(shè)置默認(rèn)值的實(shí)現(xiàn)方法的相關(guān)資料,這里提供實(shí)現(xiàn)方法幫助大家實(shí)現(xiàn)這樣的功能,需要的朋友可以參考下

AngularJS的select設(shè)置默認(rèn)值

在使用Angular時(shí)候使用select標(biāo)簽時(shí)會遇到綁定數(shù)據(jù)指定默認(rèn)顯示值可這樣實(shí)現(xiàn)

<!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 : "任務(wù)" 
    }, { 
      id : '02', 
      name : "日志" 
    }, { 
      id : '03', 
      name : "會議" 
    }, { 
      id : '04', 
      name : "學(xué)習(xí)" 
    }, { 
      id : '05', 
      name : "總結(jié)" 
    }, { 
      id : '99', 
      name : "其他" 
    } ]; 
    $scope.ZNoteVo={}; 
    $scope.ZNoteVo.type = "03"; 
  }); 
</script> 
</html> 

當(dāng)我們選擇類型是03時(shí)則默認(rèn)是會議

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

相關(guān)文章

最新評論

新余市| 宿州市| 遂川县| 延吉市| 丰原市| 育儿| 临高县| 蒲江县| 黄梅县| 惠安县| 金溪县| 丰都县| 库尔勒市| 苍南县| 甘泉县| 突泉县| 竹溪县| 太保市| 临西县| 宜兴市| 南雄市| 黄平县| 肥乡县| 吴桥县| 黑山县| 桐庐县| 阳谷县| 桓台县| 连江县| 郑州市| 莒南县| 师宗县| 德格县| 屏山县| 百色市| 健康| 平山县| 任丘市| 固原市| 黑水县| 开江县|