Search code examples
angularionic-frameworkionic3command-line-interfaceionic-cli

How to add pages to app.module.ts in Ionic using CLI


I am new to Ionic and when generating the pages in Ionic, we have to manually add the pages to the app.module.ts.

Is there any way to add pages to app.module.ts using CLI in Ionic?

I am trying this: ionic g page <pagename> --module=app

Any answers is much appreciated.


Solution

  • ionic g page <pagename> out to be enough. It should also automatically add it to your app.module.ts, if not add it to declarations and entryComponents.