尝试在 ngfor 中使用 ng-multiselect。无法正确获取所选数据

Trying to use ng-multiselect inside ngfor. unable get selected data properly

我有一个json,那里会有一个动态数据。所以,我循环遍历 ngfor 并在 ngfor 内部我需要一个具有搜索功能和多个 select 的下拉菜单。所以我正在使用 ng-multiselect-dropdown.

这是我在 stackblitz 上尝试过的代码 --> click here

     <div class="row" *ngFor="let abc of dropdownList1; let i = index">
{{abc.Meteritem_text}}  <ng-multiselect-dropdown [placeholder]="'custom placeholder'" [data]="abc.services" [(ngModel)]="abc.selectedItems" [settings]="dropdownSettings"    name='countrySelect'> </ng-multiselect-dropdown>
 </div>

如果我 select 下拉列表中的任何值,它是 select 所有复选框。请指出哪里出了问题。

ng-multiselect 下拉菜单的 dropdownSettings 错误。 idField: "item_id" 应该是 idField: "id" 对于 ngFor 循环的 ng-multiselect 下拉列表..

我已经编辑了您的 stackblitz 代码以使其工作。请验证: https://stackblitz.com/edit/angular-multiselect-dropdown-3gdrew?file=app/app.component.ts