Deleting selected items from mat-list not working in angular 2 using angular material

前端 未结 1 1090
天涯浪人
天涯浪人 2020-12-20 09:06

I have implemented a simple table in angular 2 using angular material ..Implemented two methods , first is transferSelectedRows which on selecting rows from

1条回答
  •  被撕碎了的回忆
    2020-12-20 09:58

    You can modify your removeSelectedRows() to filter the selected items in the table:

    removeSelectedRows() {
        this.selection.selected.forEach(item => {
          this.selectedRows = this.selectedRows.filter(element => element !== item);
        });
      }
    

    0 讨论(0)
提交回复
热议问题