Ask Your Question
1

When I create a new ionic project using angular, why are the module.ts and app-routing.module.ts files not being generated in the project?

asked 2023-07-17 17:30:43 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-07-17 17:40:02 +0000

devzero gravatar image

The module.ts and app-routing.module.ts files are typically generated when you run the Ionic CLI command ionic generate page <page-name>. These files are specific to individual pages/components within an Ionic app and are not typically generated by default when creating a new project.

However, if you would like these files to be generated with your new project, you can manually create them by running the following commands in your terminal:

ng g m app-routing --flat --module=app
ng g m <page-name>
ng g c <page-name> --skipTests=true --module=<page-name>

The first command generates the app-routing.module.ts file, the second command generates a new module for your page/component, and the third command generates a new component for your page/component within the previously generated module.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-17 17:30:43 +0000

Seen: 13 times

Last updated: Jul 17 '23