【发布时间】:2018-10-07 02:41:57
【问题描述】:
更改我的 UI 项目的架构后,我遇到了很多错误(TS1219 和 TS2304)。原因是配置 tsconfig.json 不好?还是其他原因? 如果我从项目中删除装饰器,一切都很好,但我需要它们。 我使用 Visual Studio 2017、ASP.CORE 2.1 模板来实现 Angular 5。
错误 TS1219 (TS) 对装饰器的实验性支持是一项可能会在未来版本中更改的功能。设置“experimentalDecorators”选项以删除此警告。
tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2017",
"dom"
],
"moduleResolution": "node",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
]
}
}
如果您需要更多信息,请告诉我。
UPD:app.module 中的@NgModule 错误不会出现 当我将带有装饰器的 ts 文件包装到文件夹中时,会出现错误。 它不适用于深度较大的文件吗?
您可以在我的bitbucket(BooksRework branch) 上看到文件夹树。
【问题讨论】:
-
问题仍然相关
标签: json visual-studio typescript webpack configuration