【问题标题】:Typescript:error TS2377: Constructors for derived classes must contain a 'super' call打字稿:错误 TS2377:派生类的构造函数必须包含“超级”调用
【发布时间】:2020-10-23 21:25:10
【问题描述】:

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

export class UploadDocumentTemplateComponent extends FieldType {}

我有这条线,因为它我收到了这个错误

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

如何解决这个问题?

【问题讨论】:

  • 这就是UploadDocumentTemplateComponent 的所有代码吗?

标签: angular typescript inheritance constructor angular7


【解决方案1】:

只是在你需要的构造函数中

constructor()
{
   super()
}

【讨论】:

    猜你喜欢
    • 2015-10-20
    • 2012-05-27
    • 1970-01-01
    • 2020-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-19
    • 2020-02-22
    相关资源
    最近更新 更多