1

I have a couple of UI Selects, based on the selection of the first one I want to load the choices into the second one. How do I go about doing it dynamically for the second one. I did do some extensive searching but could not find anything.

<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>

This is the first of my ui select which has the choices and based on these choices I want to load the data into the second UI select is there a way to achieve this?

2
  • Can you create a dummy jsfiddle or plunkr. On select of the first ui-select, you could reset the options in the second ...It totally depends on how you have your options set. Commented Jul 19, 2017 at 3:25
  • Thanks I got it I changed the array for the second ui-select based on the option selected in the first ui-select. Commented Jul 19, 2017 at 4:02

1 Answer 1

1

Call a function on-select of the first ui-select and set the second ui-select accordingly in that function. Refer this https://github.com/angular-ui/ui-select/wiki/ui-select

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.