Ionic angular 4 project understanding


So, if u do a ionic start it creates the app project having a
app.module.ts with all the required page import, declartion and entry points.

This all works fine.

But going forward if you add a new page using ionic g page then it ends up generating its own module file.

and same way if you generate a component using ionic g component it generates an entry into components.module.ts in the declartion and export for the module.

Now what is the recommended way for the component to use in the generated page? which file and what entries i need to make the custom component available to the newly generated page?


By no means is this an official recommendation, just my personal opinion.

I would recommend not using the generators at all, and instead adding your component to the app module, eliminating the components module entirely. If you are interested in the reasoning behind this stance, read this thread.


Actually I use the option --no-module