デバイスの配列があり、各デバイスにアクションが含まれています。ネストされた ng-repeat を使用して、すべてのデバイスを一覧表示し、すべてのアクションを含む選択リストを提供しています。現在選択されているアクションを常に表すプロパティをデバイス上に作成するにはどうすればよいですか? ここに私が現在持っているコードがあります:
<div class="span5 outputDevices well" droppable>
Drag a device here for output
<div class="droppedDevice" ng-repeat="outputDevice in outputDevices" >
<h1>{{outputDevice.fields.baseDevice.fields.name}}</h1>
<button class="btn btn-danger" ng-click="removeDevice('output', $index)">
X
</button>
<select class="outputActions">
<option>
Select Action
</option>
<option ng-repeat="action in outputDevice.fields.baseDevice.fields.outputs">
{{action.fields.name}}
</option>
</select>
</div>
</div>
編集:以下のコメントに従って選択を変更しようとしましたが、アクションは現在まったく繰り返されていないようです:
<select class="inputActions" ng-options="action.fields.name for action in inputDevice.fields.baseDevice.fields.inputs">
<option value="">
Select Action
</option>
</select>