Skip to content

feat(generate): support component --suffix=Route #4038

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
wants to merge 2 commits into from

Conversation

leon
Copy link
Contributor

@leon leon commented Jan 16, 2017

Allow the user to choose the component suffix at generation time.
#3913

supports all kinds of casings such as:

--suffix=route
--suffix=Route
--suffix=smart-component
--suffix=SmartComponent

@filipesilva
Copy link
Contributor

@Brocco can you review?

@cacogr
Copy link

cacogr commented Jan 16, 2017

https://angular.io/docs/ts/latest/guide/style-guide.html#02-03

Do append the symbol name with the conventional suffix for a thing of that type (e.g., Component, Directive, Module, Pipe, Service).

I don't know how strict is angular-cli about the official style guide.

@leon
Copy link
Contributor Author

leon commented Jan 16, 2017

@cacogr
It also says

Why? Provides a consistent way to quickly identify and reference assets.

I've got into the habit of naming all my route files .route.ts since it makes it easy to find routes.

I can see that the style guide has a couple to get started with, .component, .pipe and so on.
But I don't see why we shouldn't evolve this to include more over time.

Say we have a lot of modals in our app. naming all modal components .modal.ts is a good way to just by looking at the filename know that this is a modal.

remove-user-modal.component.ts
or
remove-user.modal.ts

Almost all UI stuff is going to be components so I would say naming everything as .component.ts is an antipattern.

@delasteve
Copy link
Contributor

delasteve commented Jan 16, 2017

@cacogr,

The styleguide does allow for new types.

https://angular.io/styleguide#!#02-02

Do use conventional type names including .service, .component, .pipe, .module, .directive. Invent additional type names if you must but take care not to create too many.

@Brocco
Copy link
Contributor

Brocco commented Jan 17, 2017

Closing per this comment

@Brocco Brocco closed this Jan 17, 2017
@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 Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants