Javascript 如何在angularjs中动态更改ui选择的选项
我有两个UI选择,基于第一个的选择,我想将选择加载到第二个。对于第二个,我应该如何动态地执行它。我做了一些广泛的搜索,但什么也没找到Javascript 如何在angularjs中动态更改ui选择的选项,javascript,angularjs,ui-select,ui-select2,angular-ui-select,Javascript,Angularjs,Ui Select,Ui Select2,Angular Ui Select,我有两个UI选择,基于第一个的选择,我想将选择加载到第二个。对于第二个,我应该如何动态地执行它。我做了一些广泛的搜索,但什么也没找到 <ui-select append-to-body="true" ng-model="requirementChoice" theme="bootstrap" ng-disabled="disabled" close-on-select="true" title="choose a requi
<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>
{{requirementChoice}
{{choice}}
这是我的第一个ui选择,它有选择,根据这些选择,我想将数据加载到第二个ui选择中。有没有办法实现这一点?在选择第一个ui选择时调用函数,并在该函数中相应地设置第二个ui选择。
参考此可以创建一个伪JSFIDLE或plunkr。在选择第一个ui选择时,您可以在第二个ui选择中重置选项…这完全取决于您如何设置选项。谢谢,我得到了它,我根据在第一个ui选择中选择的选项更改了第二个ui选择的数组。