Skip to content

rename feature-routing.module.ts to feature.routing.ts #8116

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

Closed
progral opened this issue Oct 19, 2017 · 4 comments
Closed

rename feature-routing.module.ts to feature.routing.ts #8116

progral opened this issue Oct 19, 2017 · 4 comments
Labels
area: @schematics/angular feature Issue that requests a new feature
Milestone

Comments

@progral
Copy link

progral commented Oct 19, 2017

Bug Report or Feature Request (mark with an x)

- [ x ] bug report -> please search issues before submitting
- [ ] feature request

Repro steps.

ng g m product-admin --routing

will produce
product-admin.module.ts
product-admin-routing.module.ts

Current Problem

Angular cli creates a module with product-admin.module and a module with product-admin-routing.module. This looks odd because it creates product-admin.component, product-admin.service, and so on. Perhaps it looks not only odd but is even wrong, because the complete angular world names with schema my-very-awesome-feature.[technical].ts like product-admin.state.ts, product-admin.actions.ts, product-admin.models.ts. Thats why product-admin.routing.ts should the correct way.

I know the routing module is a module - but it is only used for routing so it is not a classic "module". Thats why we need not name it "module".

I guess the naming comes from an early routing tutorial on angular.io. They named it hero-routing.module.ts there. That was just a quick example, how we could do it. Nevertheless most of the world outside named their routing module just feature.routing.ts. Some tools do it also. E.g. vscode-material-icons mark files with *.routing.ts as an angular routing file.

Desired functionality.

ng g m product-admin --routing

will produce
product-admin.module.ts
product-admin.routing.ts

@filipesilva filipesilva added P5 The team acknowledges the request but does not plan to address it, it remains open for discussion feature Issue that requests a new feature labels Oct 25, 2017
@hansl hansl unassigned Brocco Feb 6, 2018
@progral
Copy link
Author

progral commented Feb 16, 2018

Is there any workaround for this. Can not imagine that noone cares. The default in almost all projects is feature.routing.ts. Do all of them rename it by hand?

@devoto13
Copy link
Contributor

You should be able to change it by using custom schematics. But custom schematics feature does not seem to be very documented... #7627

Also see -c flag in ng generate command - https://github.com/angular/angular-cli/wiki/generate.

@filipesilva filipesilva added area: @schematics/angular and removed P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Oct 8, 2019
@ngbot ngbot bot modified the milestone: Backlog Oct 8, 2019
@alan-agius4
Copy link
Collaborator

Hi @xipheCom, thanks for this feature request.

As mentioned by @devoto13, you can create custom module schematic that use @schematics/angular module schematic and change the file name to .routing.

Changing the default module schematic to generate a .routing suffix will break a lot of online courses, documentations and style guides.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @schematics/angular feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

5 participants