ng generate module my-routing-module --routing && ng generate component my-component --module=my-routing-module
In this example, ng generate module is used to generate a routing module called my-routing-module with the --routing option to also generate a separate routing module file.
Then, ng generate component is used to generate a component called my-component, and the --module option is used to specify that the component should be added to the my-routing-module module.
This command will create a new directory called my-component containing a component file and its associated files, and it will also add the component to the declarations array in the my-routing-module module file.