fix(command/generate): directive selector should be camelcase
See original GitHub issueGenerating a directive using:
$ ng g directive my-directive
Generates a directive that looks like this:
@Directive({
selector: 'my-directive',
providers: [],
host: {},
})
class MyDirective {}
There are a two things that need a fix IMO:
- directive selectors should be camelcase, so instead of
my-directive
I should getmyDirective
providers
andhost
are not necessarily needed maybe we can simply remove those?- If we can’t remove them, then the trailing comma and newline should be at least removed
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
The conflict between angular directive selector and tslint
This is the answer I got: While Angular does support class selectors for directives, this feature should be used only in special circumstances ......
Read more >Rule: directive-selector - codelyzer
A single prefix (string) or array of prefixes (strings) which have to be used in directive selectors. kebab-case or camelCase allows you to...
Read more >angular-in-action.pdf
from the App component code, there was a selector of app-root used to identify the component in markup. You should see the following...
Read more >(PDF) Ngcourse | gholam reza mohammadi - Academia.edu
For directives, the selector name must be camelCase and wrapped in square brackets to specify that it is an attribute binding. We're using...
Read more >Eclipse Jetty: Operations Guide
Enabling the postgresql module will execute the [files] directive ... you can display the JVM command line to verify that it is correct....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you want you can play with the branch I’m working on should have the full PR ready in the next few days
https://github.com/Brocco/angular-cli/tree/style-guide
good question … not sure.
mySillyDirectiveName
would be ideal … but I think it is very reasonable to make itmySiLyDiRECTiveName