I am trying to implement multiselect using ng2-select Here is may view block code,
<ng-select
[multiple]="true"
[items]="items"
[disabled]="disabled"
(data)="refreshValue($event)"
(selected)="selected($event)"
(removed)="removed($event)"
placeholder="Select from list"></ng-select>
and in component I have items list and selected value list
private value:any = [{id: "1", text: "User A"}];
private items:Array<Object> = [{id: "1", text: "User A"},{id: "2", text: "User B"},{id: "3", text: "User C"}];
private selected(value:any) {
console.log('Selected value is: ', value);
}
private removed(value:any) {
console.log('Removed value is: ', value);
}
private refreshValue(value:any) {
this.value = value;
}
How can I achieve "select all" and "unselect all" functionality in it and ng-select is not populate select item in view.