【发布时间】:2019-01-25 04:35:44
【问题描述】:
我在 Visual Studio 2017 中使用 AngularJS 创建了一个 .Net Core 项目,但是当我尝试创建服务时,我收到一个错误,因为
对装饰器的实验性支持是一项可能会在未来版本中更改的功能。设置 'experimentalDecorators' 选项以删除此警告。
我检查了几个链接,例如编辑 tsconfig.json 以下链接,例如 link1 和 link2
现在我的 tsconfig.json 如下所示
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"experimentalDecorators": true,
"allowJs": true,
"noEmit": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"include": [
"app/**/*"
],
"files": [], //add a "files" array (in my case empty)
"exclude": [
"node_modules"
],
"typeAcquisition": {
"enable": true // helps fuel better js intellisense
}
}
但我仍然看到错误,我现在一无所知。
【问题讨论】:
-
你关闭了VS再打开了吗?可能需要重新启动智能感知才能注意到更改。
-
我尝试关闭和打开项目,但它又给了我同样的错误
标签: angular typescript typescript2.0 asp.net-core-2.1