Skip to content

Generate module with --routing=true #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
len-ny opened this issue Apr 2, 2025 · 3 comments
Open

Generate module with --routing=true #7

len-ny opened this issue Apr 2, 2025 · 3 comments

Comments

@len-ny
Copy link

len-ny commented Apr 2, 2025

How to generate the routing file together when generating the module? The popup menu doesn't have this option.

@ManuelGil
Copy link
Owner

Hi @len-ny ,

The option to create modules with CLI through this extension is not available to suit Angular versions with standalone components by default.

You have two options to create these modules:

  • The first option is to create a custom command in the settings this way:

    {
      "angular.submenu.customCommands": [
        {
          "name": "Routing Module",
          "command": "ng g m",
          "args": "--routing=true"
        }
      ],
    }

You can be guided by the documentation.

  • The second option is to create an empty module file and use the ng_class_routing_module snippet to launch the autocompletion of this extension.

Image

I hope you find this information helpful.

@len-ny
Copy link
Author

len-ny commented Apr 4, 2025

Thanks for your reply:

  1. The "Generate custom element with CLI" isn't working properly. It ignores the element name input by me and execute "ng g m undefined --routing=true", which created src/app/undefined/undefined-routing.module.ts and src/app/undefined/undefined.module.ts.

  2. The ng_class_routing_module snippetl has more steps than just executing ng g m --routing=true. It defeats the purpose of using this generator extension.

@ManuelGil
Copy link
Owner

Hello @len-ny ,

Thank you so much for your patience and for taking the time to report this! I'm very sorry for the delay in responding. I am checking to see if you have already found a solution or if you are still blocked by this problem. If not, I'd like to help you find a solution. In the meantime, you can manually run ng generate module with the desired options as a workaround.

Please let me know where you are in this case so that we can solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants