-
Notifications
You must be signed in to change notification settings - Fork 12k
Create a route module when generating a module #3243
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
Comments
Have you tried the
|
I didn't know about that command! |
@delasteve Can u update the readme with this feature for others? |
https://github.com/angular/angular-cli/wiki/module Additionally, @Brocco has a PR out there to move the docs to the repo #3382 |
And if I need the html , scss annd the component of this ? |
Hi @delasteve, I tried using your method for generating routing module. But it seems like it doesn't do the trick. I have another just-module.ts file in my directory. When I try to generate routing module, the latest versioned angular-cli I am using throws me an error of already-existing-module inside the directory. |
@waleedshkt If the module already exists, the CLI will throw errors. Just delete that file and then run the command again with the |
@josephdgb1996 You just generate a component with the same name as your module. Using the example @delasteve gave you'd just run |
ng g m moduleName --routing |
Thanks. Did not know such command exists. This works perfect ! |
@josephdgb1996 module does not have html or scss. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
#Routing_module
According to angular documentation, it's considered the best practice to add routing module for each module, so my suggestion is, when generating a module, i think it makes sense to create a route module for it.
#update
Because it's not usually the case, may be another command like
ng g module routing x
instead ofng g module x
Namaste
The text was updated successfully, but these errors were encountered: