Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Select with multiple resets bound ng-model on initialization #433

Closed
ciddan opened this issue Nov 24, 2014 · 2 comments
Closed

Select with multiple resets bound ng-model on initialization #433

ciddan opened this issue Nov 24, 2014 · 2 comments

Comments

@ciddan
Copy link

ciddan commented Nov 24, 2014

We're having an annoying issue with the multi-select box and loading an initial value for its ng-model. For some reason it blanks the bound field on initialization. If the initial value is [12, 13, 14] - as soon as the ui-select directive is loaded it get reset to []. All the options show up OK, though. We've also made sure that when we do select values in the select box, it does indeed update the bound model in the correct format (int array, [12, 13, 14]).

Here is our markup:

<ui-select id="Keoni_Agility_ObjectPreviewAttributes"
           multiple
           ng-model="settings.Keoni_Agility_ObjectPreviewAttributes.value"
           theme="bootstrap"  style="width: 100%" >
    <ui-select-match placeholder="Choose an attribute">{{$item.name}}</ui-select-match>
    <ui-select-choices repeat="attr.id as attr in viewModel.generalAttributes | filter: $select.search">
        <div>{{attr.name}}</div>
    </ui-select-choices>
</ui-select>

The options are loaded from an Object array, where we use their respective id's as their selection value.

@yaneq
Copy link

yaneq commented Nov 24, 2014

This might help you: #404

@wesleycho
Copy link
Contributor

Going to close in favor of referenced issue. If that is not the issue, please open a new issue with an appropriate reproduction in Plunker based on the latest release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants