valor-software / ng2-select

Angular based replacement for select boxes
http://valor-software.github.io/ng2-select/
MIT License
676 stars 588 forks source link

Issues with multiple selection in a single page #874

Open arinhere opened 6 years ago

arinhere commented 6 years ago

Hi,

In my app, I have 3 ng-select on a single page. Each of the cases have multiple enabled.

What I tried to achieve is, to set different initial selection, when the page is loading.

What I have done so far

<ng-select (data)="value" [multiple]="true" [items]="participants" [disabled]="disabled" (data)="refreshValue($event)" (selected)="selected($event)" (removed)="removed($event)" [(ngModel)]="selectedCharacters" name="participantlist{{i}}">

Interesting part is, [(ngModel)]="selectedCharacters" works, if its static. But if I tried to iterate it like selectedCharacters[i], it stopped working.

Any idea, how to resolve this issue.

Please let me know

Thanks