打字稿:错误TS2377:派生类的构造函数必须包含“超级”调用

时间:2020-07-03 07:32:26

标签: angular typescript inheritance constructor angular7

我正在尝试在我的代码中实现这个Stackblitz example的angular-upload-file-with-progress-bar

export class UploadDocumentTemplateComponent extends FieldType {}

我有这行是因为我收到了这个错误

错误TS2377:派生类的构造函数必须包含一个“超级”调用。

如何解决此问题?

1 个答案:

答案 0 :(得分:4)

仅在您需要的构造函数中

constructor()
{
   super()
}