错误:已加载BrowserModule。在角度7

时间:2019-12-23 09:54:08

标签: 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.

Angular 5升级到7后,出现此错误。请帮我解决这个问题

2 个答案:

答案 0 :(得分:1)

  

<form class='io'> <table> <thead> <tr> <th>Type</th> <th>Desciption</th> <th>Image/URL</th> <th><button>➕</button></th> </tr> </thead> <tbody class='grid'> <tr> <td> <select class='type'> <option value="X" default></option> <option value="GDS">Guides</option> <option value="PRO">Promos</option> <option value="TEM">Templates</option> <option value="VID">Videos</option> </select> </td> <td><textarea class='desc data' rows='1' cols='20' disabled></textarea></td> <td><textarea class='urls data' rows='1' cols='20' disabled></textarea></td> <td><button class='del' type='button'>❌</button></td> </tr> </tbody> </table> </form> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> 中仅在 modules 下方导入:

root module (app.module.ts)

答案 1 :(得分:0)

自己修复

全局和本地项目的ng版本完全不同。卸载全局ng版本后,此问题得以解决。在冲突期间,我有多个webpack列表。删除该webpack后,效果很好

相关问题