matsura / ng2-dual-list-box

A dual list box component for Angular 4
http://ng2-duallistbox-demo.surge.sh/
28 stars 20 forks source link

Default Items not showing in selected section #33

Open gauravshri12 opened 6 years ago

gauravshri12 commented 6 years ago

<ng2-dual-list-box [data]="resultData" valueField="id" #name textField="name" (onAvailableItemSelected)="log($event)" (onSelectedItemsSelected)="log($event)" formControlName = "selectedItems" [availableText]="'Available Templates'" [selectedText]="'Selected Templates'" (onItemsMoved)="log($event)">

selectedItems: any[] = [ { "name":"Delivering Status", "id":7 }, { "name":"Ship From Postal Code", "id":5 } ];

image

crissty commented 6 years ago

Any update about this? I get the same behavior, Maybe, Is not this behavior contemplate?

akshaydusane commented 6 years ago

Please update if some solution for this is there I am also facing same issue

shubhatg commented 5 years ago

export class AppComponent { title = 'app works!'; items = []; selected = [];

constructor() {

for (let i = 1; i < 100; i++) {
  this.items.push({
    id: i.toString(),
    name: 'Name ' + i
  });
}
this.selected = [this.items[0].id, this.items[1].id];

}

log(data) { console.log(data); } }