如何处理Angular项目在Visual Studio Code打开报关于@Decorators的警告信息
生活随笔
收集整理的這篇文章主要介紹了
如何处理Angular项目在Visual Studio Code打开报关于@Decorators的警告信息
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我最近用Visual Studio Code開發Angular項目時,打開app.component.ts, 就遇到如下的警告消息:
Experimental support for decorators is a feature that is subject to change in a future release. Set the ‘experimentalDecorators’ option in your ‘tsconfig’ or ‘jsconfig’ to remove this warning.ts(1219)
解決辦法:
在項目根目錄的tsconfig.json文件里,加入如下設置:
/*This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.It is not intended to be used to perform a compilation.To learn more about this file see: https://angular.io/config/solution-tsconfig. */ {"files": [],"references": [{"path": "./tsconfig.app.json"},{"path": "./tsconfig.spec.json"}],"compilerOptions": {"experimentalDecorators":true,"emitDecoratorMetadata": true} }
關掉所有文件,進入Angular項目根目錄,code .重啟Visual Studio Code,錯誤消失:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的如何处理Angular项目在Visual Studio Code打开报关于@Decorators的警告信息的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微软第 3 财季 Xbox 硬件销量下降
- 下一篇: Angular list列表绑定的一个例