Ole*_*Ole 0 javascript typescript visual-studio-code angular
我刚刚安装了 Angular 10 并将 VSCode 升级到最新版本。
创建新模块时:
import { NgModule } from '@angular/core';
const mm = []
@NgModule({
imports: [ ...mm ],
exports: [...mm
],
providers: [
]
})
export class MaterialModule {
}
Run Code Online (Sandbox Code Playgroud)
创建此装饰器错误:
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)
Run Code Online (Sandbox Code Playgroud)
它仅为新模块创建。现有的app.module.ts没有错误……所以有点混乱。
小智 5
在您的tslint.config 中添加此行以避免此 lint 错误。
“experimentalDecorators”:true
并且还检查了visual studio设置中的启用实验装饰器选项,如下所示
希望它会有所帮助。