首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >实验性装饰器警告VSCODE

实验性装饰器警告VSCODE
EN

Stack Overflow用户
提问于 2016-09-30 16:36:12
回答 1查看 2.3K关注 0票数 5

我正在开发一个Angular2-Typescript应用程序。我已经用angular-cli生成了这个项目,如下所示:

代码语言:javascript
复制
ng new myApp

但是当我创建一个新组件时,@ component标签上会出现一条警告。

我试着在下面这篇文章中解决:

Experimental decorators warning in Visual Studio Code

但对我不起作用。

我附上我的tsconfig.json:

代码语言:javascript
复制
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es6",
"typeRoots": [
  "../node_modules/@types"
  ]
 }
}

Typescript版本为:"typescript":"2.0.2“

EN

回答 1

Stack Overflow用户

发布于 2016-09-30 19:24:17

最后,我解决了我的问题如下:

首先,更新typescript版本:

代码语言:javascript
复制
$ npm install typescript@next

然后,在vscode中编辑用户首选项,添加以下内容:

代码语言:javascript
复制
{
  "typescript.tsdk": "node_modules/typescript/lib"
}

感谢peeskillet :)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39787118

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档