【发布时间】:2018-09-22 08:14:42
【问题描述】:
我有一个Angular 4 项目,起初我可以使用ng generate component 命令,但由于我已经实现了Routing,因此该命令不再有效,因为我收到以下错误
错误:多个模块匹配。使用 skip-import 选项跳过将组件导入最近的模块。 多个模块匹配。使用 skip-import 选项跳过将组件导入最近的模块。
我不太确定是不是 Routing 导致了这种情况,但我似乎只能指手画脚,我需要修复它
【问题讨论】:
-
你可以通过
ng g c newComponent --module targetModuleName告诉angular你想要添加新组件的模块