我想用兩個或三個選項作出選擇列表,這取決於ng-repeat中的第一個選定選項。當客戶在第一個選項「半球攝像機」中選擇時,根據列出的安裝項目(在這種情況下:屋頂,牆壁和杆),第二次重複應該只列出兩個選項。顯示一個ng-repeat select選項(AngularJS)
有人可以幫助我嗎?
<tr>
<td>
<select class="form-control" name="type-camera">
<option ng-repeat="camera in cameraTypes">{{camera.name}}</option>
</select>
</td>
<td>
<select class="form-control" name="type-camera">
<option ng-repeat="mounting in ?????">{{mounting}}</option>
</select>
</td>
</tr>
的$ scope.cameraTyps樣子:
"0": {
"name": "Dome Camera",
"price": 2975.67,
"install": 4,
"mounting": {
"name": "roof",
"name": "wall",
"name": "pole"
}
},
"1": {
"name": "WV-SF135E",
"price": 327.70,
"install": 1.5,
"mounting": {
"name": "roof",
"name": "wall"
},
"lens": "fixed"
}
如果回答這些問題的解決你的問題,你可以隨時將其標記通過檢查刻度爲接受它旁邊 –