Components.module.ts file's purpose

Hi,

in my app, I created a component with Ionic cli. The command generated a components.module.ts file in components folder.

I also had this component inside app.module.ts :

import { RatingComponent } from '../components/rating/rating';
...

@NgModule({
  declarations: [
    MyApp,
    ...,
    RatingComponent
  ],

When I run ionic build --prod, I get this error :

Type RatingComponent in E:/Ionic/test/src/components/rating/rating.ts is part of the declarations of 2 modules: AppModule in E:/Ionic/test/src/app/app.module.ts and ComponentsModule in E:/Ionic/test/src/components/components.module.ts! Please consider moving RatingComponent in E:/Ionic/test/src/components/rating/rating.ts to a higher module that imports AppModule in E:/Ionic/test/src/app/app.module.ts and ComponentsModule in E:/Ionic/test/src/components/components.module.ts

So : how to correctly import components in Ionic 3 App ?

Thanx for your help !

https://ionicframework.com/docs/cli/generate/ has a --no-module parameter if you don’t want your own module.