HTML:
<div ng-repeat="gridRow in gridData" class="row">
<select ng-options="room as room.OpRoomName for room in RoomNameList track by room.OpRoomId" ng-model="gridRow.RoomId"></select>
{{gridRow.RoomId}}
</div>
数据:
gridData = [{
A: 2,
B: 3,
RoomId: 1
}, {
A: 2,
B: 3,
RoomId: 3
}, {
A: 2,
B: 3,
RoomId: 5
}]
RoomNameList = [{
OpRoomName: "A",
OpRoomId: 1
}, {
OpRoomName: "B",
OpRoomId: 2
}, {
OpRoomName: "C",
OpRoomId: 4
}, {
OpRoomName: "D",
OpRoomId: 3
}, ]
无法设置所选选项