【发布时间】:2019-08-21 09:49:50
【问题描述】:
当我在tsconfig.json 中添加strictBindCallApply:true 并运行ng build 时,我得到以下信息:
src/app/hot/hot.component.ts(538,61) 中的错误:错误 TS2345:“IArguments”类型的参数不可分配给“[Core, HTMLTableCellElement, number, number, string | number, any, CellProperties]'。
类型“IArguments”缺少类型“[Core, HTMLTableCellElement, number, number, string | number, any, CellProperties]': 0, 1, 2, 3, 还有 32 个。
相关代码部分如下:
const cellValidationTempVar = this.cellValidation;
this.cellValidation[i].renderer = function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments); // HERE!
if (instance.getDataAtCell(row, col).length > cellValidationTempVar[col].length ) {
td.classList.add('htInvalid');
} else {
td.classList.remove('htInvalid');
}
}
Handsontable.renderers.TextRenderer.apply(this, arguments); 语句与documentation 中使用的语句相同。
我正在使用:
- Angular 7.2
- 掌上电脑 7.0.0
- 打字稿 3.2.4
没有strictBindCallApply,构建工作正常。
【问题讨论】:
标签: angular typescript handsontable