使用Angular CLI工具生成组件出错
1 | Error:More than one module matches. Use skip-important option to skip importing the component into the closest module. |
查看了Angluar CLI的官方文档,没找到原因,在stackouverflow上找到了,原因是在我的应用中有多个模块,不指明是哪一个模块的组件的话,它不知道这个组件属于谁,所以解决方法就是1
ng g c \shared\test --module app //shared指在shared文件夹下生成test组件,它是app模块的组件
亲测成功。