1、当创建使用ng g c battery-realtime-data创建组件时提示:
More than one module matches. Use skip-import option to skip importing the component into the closest module.
入下图所示:
出现此问题是此项目中有多个以.module.ts的文件存在,创建时无法确定将组件导入那个module中,因此要通过--module来指定,通过使用ng g c battery-realtime-data --module=wincom-battery来创建即可,入下图所示:
注意:--module=后边等的值是将.module.ts去掉的名称