当使用Angular项目时,我正在导入核心Angular NgModules,而Webstorm告诉我它们不是有效的Angular模块。
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule, // Gets the error
AppRoutingModule,
SharedModule,
HttpClientModule, // Gets the error
UpgradeModule, // Gets the error
CoreModule,
],
providers: [],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
Run Code Online (Sandbox Code Playgroud)
我要导入的所有模块app.module
都出现红字,表示它们不是Angular模块。我不能忍受着看代码。谁看过这个吗?请帮忙。
我与网络风暴小组进行了一次Google Hangout,他们发现我的任何一个都没有node_modules
被索引。我打开了项目首选项,并将其node_modules
从排除的目录中删除。完全工作。
Command + ,
以打开“首选项”。Directories
你左手的偏好菜单。node_modules
从右侧的排除部分中删除。有效。
归档时间: |
|
查看次数: |
210 次 |
最近记录: |