You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(command/generate): directive selector should be camelcase #424
This will be included with the style-guide alignment PR I'm working on, so keep an eye out for that.
When running ng g directive myDir the selector should be myDir
However when running ng g directive my-dir should the selector be my-dir or myDir
my suggestion would be for my-dir
Furthermore if I run ng g directive mySiLyDiRECTiveName should the selector be mySiLyDiRECTiveName
For the initial I will implement it as what you provide as the argument will be the selector used in the directive this way the dev can explicitly decide on what the name will be.
This issue has been addressed via PR #427 selectors for directives will not adjust the name entered via the CLI (i.e. ng g directive FoObAr will have a selector: FoObAr)
Activity
Brocco commentedon Apr 12, 2016
This will be included with the style-guide alignment PR I'm working on, so keep an eye out for that.
When running
ng g directive myDirthe selector should bemyDirHowever when running
ng g directive my-dirshould the selector bemy-dirormyDirmy suggestion would be for
my-dirFurthermore if I run
ng g directive mySiLyDiRECTiveNameshould the selector bemySiLyDiRECTiveName//CC @IgorMinar @johnpapa
johnpapa commentedon Apr 12, 2016
good question ... not sure.
mySillyDirectiveNamewould be ideal .... but I think it is very reasonable to make itmySiLyDiRECTiveNamejohnpapa commentedon Apr 12, 2016
I agree with all of @PascalPrecht 's points too.
Brocco commentedon Apr 12, 2016
For the initial I will implement it as what you provide as the argument will be the selector used in the directive this way the dev can explicitly decide on what the name will be.
0x-r4bbit commentedon Apr 12, 2016
@Brocco tbh I haven't thought of simply doing
ng g directive camelCase. This would totally do it.Brocco commentedon Apr 12, 2016
@PascalPrecht correct, but the current version will output the dasherized name see here
0x-r4bbit commentedon Apr 12, 2016
Oh then I misunderstood this. Thought this was already the case. Then I'm looking forward to this! :)
Brocco commentedon Apr 12, 2016
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
Brocco commentedon Apr 19, 2016
This issue has been addressed via PR #427 selectors for directives will not adjust the name entered via the CLI (i.e.
ng g directive FoObArwill have a selector:FoObAr)angular-automatic-lock-bot commentedon Sep 5, 2019
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.