选择值不返回当前选择的值-角度,打字稿

时间:2020-03-15 22:53:48

标签: javascript angular typescript angular-material angular8

我正在使用复选框选择一行...。单击复选框后,它应该获得一个对象值。

现在,它返回一个[object set]值,但实际上并没有选择或获取行中的实际值。

我在这里想念什么?

selection.component.ts

      deleteRow() {

    this.selection.selected.forEach(item => {
      const index: number = this.dataSource.view['source']['value'].TableData.filter (
        (d: TableRow) => d === item
      );
      this.dataSource.view['source']['value'].TableData.splice(index, 1);
      console.log(this.dataSource);
      this.dataSource = new ViewDataSource(this.dataSource.view['source']['value'].TableData);
    });
    this.selection = new SelectionModel<TableRow>(true, []);
    this.actionService.deleteRow(this.selection, this.primaryTableValue).subscribe(response => {
      console.log("Success!");
    });
  }

0 个答案:

没有答案
相关问题