【发布时间】:2018-07-11 08:46:19
【问题描述】:
我想把我的文件分成几个模块。一个模块有一个构造函数。我可以将我的模块导入另一个文件,但我不知道如何在新文件中调用我的构造函数。
namespace CreditReports{
export class CreditReportVM {
//some code
constructor(targetElement: HTMLElement) {
ko.applyBindings(this, targetElement);
this.init();
}
public init = () => {
//some code
}
}
}
【问题讨论】:
标签: javascript typescript knockout.js