-
Notifications
You must be signed in to change notification settings - Fork 12k
Generated directive selector name should be camelcase #1216
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
As an addition according to the Style-Guide, the Selector for Directives should also take the prefix of the app into account. So I would assume ng g directive lower-case to create a Direktive with the selector [appLowerCase] |
@Brocco can you weigh in? |
The style guide does dictate camelCase for directive selectors and prefixing them with the application prefix. I will put together a PR for this. Reference: https://angular.io/docs/ts/latest/guide/style-guide.html#!#02-08 |
what if you prefix is kebab case? |
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. |
Version
Repro steps
The following generate command produces a kebab case selector name instead of camelCase.
src/app/shared/directives/wrap-if.directive.ts
As per the styleguide,
I've passed
ng generate
the name in kebab case because the README states so and follows the convention of passing the file name where file names should use dashes to separate words in the descriptive name.I've read #424 and acknowledge that passing the name as camelCase to
ng generate
produces the correct selector but it is unintuitive and doesn't follow the README. I don't think we should make an exception to the convention of passing kebab case file names tong generate
.Instead of not modifying the selector name at all for directives, I think they should be modified to be camelCase as per the styleguide.
The text was updated successfully, but these errors were encountered: