【发布时间】:2017-07-19 00:53:23
【问题描述】:
我有几个 UI 选择,基于第一个的选择,我想将选择加载到第二个中。我该如何为第二个动态做呢。我确实做了一些广泛的搜索,但找不到任何东西。
<ui-select append-to-body="true"
ng-model="requirementChoice" theme="bootstrap"
ng-disabled="disabled" close-on-select="true"
title="choose a requirement"
theme="selectize"
name="requirements" id="requirements">
<ui-select-match placeholder="
{{translations.SLA_CHOOSE_REQUIREMENTS}}">
{{requirementChoice}}
</ui-select-match>
<ui-select-choices repeat="choice in requirementTypes |
filter:$select.search">
{{choice}}
</ui-select-choices>
</ui-select>
这是我的第一个 UI 选择,它有选择,基于这些选择,我想将数据加载到第二个 UI 选择中,有没有办法实现这一点?
【问题讨论】:
-
你能创建一个虚拟的 jsfiddle 或 plunkr。在选择第一个 ui-select 时,您可以在第二个中重置选项...这完全取决于您如何设置选项。
-
谢谢我明白了我根据第一个 ui-select 中选择的选项更改了第二个 ui-select 的数组。
标签: javascript angularjs ui-select ui-select2 angular-ui-select