当角运行,我得到thje错误TS1086: An accessor cannot be declared in an ambient context.的的JavaScript getter和setter在这个抽象类打字稿。
这是来源:
/**
* The current id key for the EStore instance.
* @return this.config.idKey;
*/
get ID_KEY(): string {
return this.config.idKey
}
/**
* The current guid key for the EStore instance.
* @return this.config.guidKey;
*/
get GUID_KEY(): string {
return this.config.guidKey
}
Run Code Online (Sandbox Code Playgroud)
在最新版本的 Angular 之前,这一直运行良好。我们不再允许在抽象类中使用 getter 和 setter 吗?