【发布时间】:2020-05-17 14:29:11
【问题描述】:
我正在使用 Angular JS 打字稿(数据来自后端 springmicroservices。 我正在开发名为 downloadExcel( ) 的新方法
在我的 component.ts 中
Data: {
//rownum: '',
// requestID: '',
student_id: string,
date: Date,
// 'month_id': ''
};
在方法中 =>
ExcelDownload() {
const subHeader1 = worksheet.addRow(this.headerData);
subHeader1.getCell(4).value = this.Data(student_id. date); // I do want to retrieve student id and date on my cell (just 2 data)
我得到的错误
ERROR in src/app/Summary/Summary.component.ts(902,35): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ student_id: string; date: Date; }' has no compatible call signatures.
任何建议!谢谢
【问题讨论】:
-
不是因为你的类型是'student_id',而你在上面写了'studnet_id'吗?这个调用对我来说也很奇怪,因为对象有';'分隔 2 个属性(至少在您编写的错误行处)。对我来说,它应该是 ',' 而不是 ';'。只是猜测
标签: javascript java html angularjs typescript