Skip to content

Feature Request: Generate a new module without a component #3365

Closed
@johnpapa

Description

@johnpapa

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?

  1. It is easy to add a component when needed.

  2. It is distracting to generate a module and have 4 extra files created when you do not want them.

  3. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions