Reputation: 2535
i have 2 set of arrays, one in Group
and the other List Not in group
. I have 2 buttons, move to right and move to left
, so on click of them, the selected data must move to right or to left based on button we select. Here multiple selection of data in list should also be implemented. I have used jQuery but it didnt worked with array of data binded, and the selected list also didnt get active
in the class, in html, and here multiple list selection is not happening, one at a time is working
Without using jquery how can this be implemented.
DEMO: DEMO
HTML:
<li class="list-group-item" *ngFor="let item of agentInView; let i=index" (click)="select(i)" [ngClass]="{'active': selectedIndex == i, 'list-group-item': true}">{{item.value}}</li>
Ts:
selectInView(index: number) {
this.selectedinViewIndex = index;
}
Upvotes: 1
Views: 1415
Reputation: 4346
There is a demo with multiple selections and moving from one list to another.
https://stackblitz.com/edit/angular-lh5vzl?file=src%2Fapp%2Fapp.component.ts
Upvotes: 3