Command to Generate both a Routing Module & Component

There is no separate command to create routing.module file. But, that can be created while on the creation of the module:

ng generate module [module-name] --routing

or the shorthand version of the command:

ng g m [module-name] --routing

… will create the module and add the mappings/metadata linkings.

I was searching about this a bit and found some article which has a very good explanation for different kind of commands.

The Ultimate Angular CLI Reference

Leave a Comment