【发布时间】:2019-03-09 18:39:58
【问题描述】:
我正在使用ui-select 而不是本机选择。这就是问题所在:
用户可以在位置数组中选择取货地址。如果没有地址,那么他可以添加新地址。如果在 ui-select-choices 中没有搜索词,我想使用 ui-select-search 输入字段来过滤选择并添加新的 uniq 地址。有什么办法可以做到吗?
这是我的代码:
<ui-select
ng-model="order.return_address"
theme="bootstrap"
tagging="order.return_address"
tagging-label="false"
reset-search-input="false"
on-select="itemSelected($select.selected)"
ng-required="isRequired"
refresh="updateValue('pick_up', $select.search)"
refresh-delay="900"
name="pick-up-location">
<ui-select-match>{{ $select.selected.title }}</ui-select-match>
<ui-select-choices repeat="address in pickUpAddresses | filter: {title: $select.search}" refresh="refreshItems($select.search)" refresh-delay="700">
{{ address.title }}
</ui-select-choices>
</ui-select>
附:我不想看到我在 pickUpAddresses 数组的输入字段中写入的地址。
【问题讨论】: