1
我使用以下命令根據服務器數據創建多個ui-select下拉列表。我喜歡從每個下拉菜單中選擇獨立的項目。當我在一個下拉列表中選擇一個項目時,所有下拉列表都會分配相同的值。我怎樣才能分離選定的值?使用單獨的選定值進行多個ui選擇
<div ng-repeat="choiceItem in menuItem.mandatoryChoices">
<ng-form name="innerModalForm1">
<div class="form-group">
<label ng-show="choiceDescExist(choiceItem)">{{choiceItem.choiceDesc}}</label>
<div ng-class="{ 'has-error' : innerModalForm1.option.$invalid && submitted }">
<div ng-show="choiceItem.multiSelect">
<ui-select name="mandatory" multiple required ng-model="selected.mandatoryChoices[$index]">
<ui-select-match placeholder="Please select one or more">
{{$select.selected.choiceItemDesc}}
</ui-select-match>
<ui-select-choices repeat="s in choiceItem.choiceOptions | filter: $select.search">
<div ng-bind-html="s.choiceItemDesc | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
</div>
<span class="has-error" ng-show="submitted && innerModalForm1.option.$invalid">You must select this required item</span>
</div>
</ng-form>
</div>
這裏是截圖。所有三個下拉菜單都有不同的值。
[Rü尋找這個/ edit/95wvJb?p = preview – Reena
開始這樣做:''。如果有效,讓我們繼續前進。 –
@Werlang,它沒有工作。隨着你所提出的改變,我是否也需要改變'{{$ select.selected.choiceItemDesc}}'中的內容? – Nabarun