在使用Angular时候使用select标签时会遇到绑定数据指定默认显示值可这样实现javascript
<!DOCTYPE html> html
<html ng-app="noteApp" ng-controller="noteCtrl"> <head> java
<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> app
</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时则默认是会议 ui