BrowserModule has already been loaded. If ... angular坑

笔记

如果报错如下:

BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.

 

 

确保根Module中有这3,然后其他的module 中     只需要 “CommonModule”  就行。

 

 

如果继续报错, 仔细看看 导入“imports” 的module中是否导入了“BrowserModule”。

 

posted @ 2021-01-07 17:31  youliCC  阅读(727)  评论(0编辑  收藏  举报