-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Feature Request: Generate a new module without a component #3365
Comments
I agree that the default behavior of I have added this option to my local copy of the cli, |
After having a few conversations about this and thinking about it some more, I think we should have the modules just generate modules with one exception... routing modules. Routing modules can be created at two times: new app creation and module creation. So what I'm suggesting on your PR, @baruchvlz, is to completely remove the Thoughts? |
I personally think it makes sense. Especially with component generation adding the declaration to the closest module up the tree. |
@Brocco : Reading what @deebloo said, it would make sense to have the command only generate the module unless the One questions though, should the |
I would leave it as is, it will pick up the default from here if it is not specified in angular-cli.json or passed in as an argument. |
Oh, interesting thanks for pointing that out. I will make the changes to the PR. |
PR has been updated. |
PR merged, closing |
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. |
OS?
Mac OSX Sierra
Versions.
angular-cli: 1.0.0-beta.21
node: 6.9.1
os: darwin x64
Option 1
ng g m foo --no-component
This would generate the module without the component ts, css, spec, html
Option 2
ng g m foo
Or ideally the default would be to not generate a component at all. It can easily be created after by doing
ng g c bar
.Why?
It is easy to add a component when needed.
It is distracting to generate a module and have 4 extra files created when you do not want them.
Avoids having to delete 4 files with
rm bar.component.*
Details
use case ...
https://github.com/johnpapa/event-view/blob/master/src/app/core/core.module.ts
Notice this one … common use case for a module that contains mostly reusable services and only one component. And in this case, the component is not named the same as the module (and shouldnt be).
Option 2 above is my preference.
The text was updated successfully, but these errors were encountered: