【发布时间】:2023-03-15 12:34:01
【问题描述】:
我正在使用 ui-select-match 和 ng-repeat
我有一个包含五个值的数组,如下所示occurrence。
我的代码工作正常,除了当我选择 first 选项时 all 从下拉列表中消失,之后如果我选择“第二个”
比“全部”显示在下拉选项中。
这是我的html代码
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-3" id="sdlPrdAddS_sdlAvlF_awkC">
<div class="formElement" id="sdlPrdAddS_sdlAvlF_awk">
<p id="sdlPrdAddS_sdlAvlF_awkL">
<label>{{'healthcareService.addSchedule.availability.occurrence' | translate}}</label><span class="red">*</span></p>
<ui-select multiple name="occurrenceInMonth" data-ng-model="scheduleFormObj.daysOfWeekInput.occurrence" id="sS_adR_occureence" on-select="removeExtraFields()" ui-select-required="true">
<ui-select-match placeholder="{{'healthcareService.addSchedule.scheduleDetails.select' | translate}}">
{{$item}}
</ui-select-match>{{occurrence}}
<ui-select-choices repeat="occurrence in scheduleStaticObjs.occurrence">
<div ng-bind-html="occurrence"></div>
</ui-select-choices>
</ui-select>
</div>
</div>
我的对象是这样的:
scheduleStaticObjs.occurrence =
["All","First","Second","Third","Fourth","Fifth"]
【问题讨论】:
-
请编辑问题,这样不可读。 stackoverflow.com/editing-help
标签: angularjs angularjs-ng-repeat ui-select