I have a compile error when using addAll method of MdlDefaultTableModel using Typescript 2.0.6. Here's the code:
const tableData = this.events.map(event => Object.assign({}, event, { selected: false }));
this.tableModel.addAll(tableData);
This gives me the following error:
Error:(53, 28) TS2345:Argument of type '({} & Event & { selected: boolean; })[]' is not assignable to parameter of type '[IMdlTableModelItem]'. Property '0' is missing in type '({} & Event & { selected: boolean; })[]'.
If you look at addAll method in node_modules/angular2-mdl/components/table/mdl-table.component.d.ts you'll see that its parameter data has strange type signature:
addAll(data: [IMdlTableModelItem]): void;
If you change it to the following signature it will work:
addAll(data: IMdlTableModelItem[]): void;
I have a compile error when using addAll method of MdlDefaultTableModel using Typescript 2.0.6. Here's the code:
This gives me the following error:
Error:(53, 28) TS2345:Argument of type '({} & Event & { selected: boolean; })[]' is not assignable to parameter of type '[IMdlTableModelItem]'. Property '0' is missing in type '({} & Event & { selected: boolean; })[]'.
If you look at addAll method in node_modules/angular2-mdl/components/table/mdl-table.component.d.ts you'll see that its parameter
datahas strange type signature:addAll(data: [IMdlTableModelItem]): void;If you change it to the following signature it will work:
addAll(data: IMdlTableModelItem[]): void;