Commands for modules and routing

When creating a PWA, I was not sure of the module and component concepts. Had a belief there should be only one routing. Then working on the project as it grew understood maintaining it as one is an head ache, modularising it will help. Since most of the code was written the following command came in handy for converting the existing folder to modules and components.

  • Converting an existing folder to module:   ng g module <foldername>
  • If routing is needed:  ng g module <foldername> —routing
  • If module exists and need to add only routing:  ng g module <routing-file> –module <modulename>

Leave a comment