簡體   English   中英

VSCode 嘗試創建新模塊時對裝飾器的實驗性支持警告

[英]VSCode Experimental Support for Decorators Warning When Trying to Create New Module

我剛剛安裝了 Angular 10 並將 VSCode 升級到最新。

創建新模塊時:

import { NgModule } from '@angular/core';

const mm = []

@NgModule({
    imports: [ ...mm ],
    exports: [...mm
    ],
    providers: [     
    ]
})
export class MaterialModule {

}

創建此裝飾器錯誤:

class MaterialModule
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)

它只是為新模塊創建的。 現有的app.module.ts沒有錯誤……所以有點混亂。

想法? 在此處輸入圖像描述

tslint.config中添加此行以避免出現此 lint 錯誤。

“實驗裝飾器”:真

並且還檢查了 Visual Studio 設置中的啟用實驗性裝飾器選項,如下所示在此處輸入圖像描述

希望它會有所幫助。

我在 VSCode 中卸載並重新安裝了“Angular Language Support”,就成功了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM