Angular报错:Type xxxComponent is part of the declarations of 2 modules: xxxxxx

在这里插入图片描述
报错截图以上

出现原因:当前两个模块有公用组件,
文件目录结构:
在这里插入图片描述
machine-classify和tool-classify都引用了component下的creat-edit-model
当我点击tool-calssify时会在控制台报错

解决办法:
在creat-edit-model下创建moudle.ts文件,export当前组件即可解决

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_40121676/article/details/107553014