angularJS 修改操作select回顯選中的數據
阿新 • • 發佈:2018-08-21
val select oct repeat party 公司 lena mode name
使用 ng-selected 指令
<div class="form-group"> <label for="role" class="col-sm-2 control-label">所屬權限</label> <div id="roleId" class="col-sm-10"> <select class="form-control input-sm" ng-model="doctor.role" name="role" id="role"> <option ng-repeat="role in roles" ng-selected="doctor.role.id == role.id" value="{{role}}" >{{role.roleName}}</option> </select> </div> </div>
<div class="form-group"> <labelfor="partyid" class="col-sm-2 control-label">所屬公司</label> <div id="party" class="col-sm-10"> <select class="form-control input-sm" ng-model="doctor.orgCode" name="partyid" id="partyid"> <option value="1268" >CPI_330048_上電投資</option> <option ng-repeat="party in partyList" ng-selected="doctor.orgCode == party.partyid" value="{{party.partyid}}" >{{party.partyname}} </option> </select> </div> </div>
angularJS 修改操作select回顯選中的數據