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
Improve name validation with component schematic (and others) #13824
A clear and concise description of the problem or missing capability...
Using dots in component name when using component schematic (might also happen with other schematics) should fail. I.e. ng generate component a.b.x should fail.
I noticed that people who are new to Angular tend to use the schematic like this for the first time:
ng generate component hello-world.component
which produces something funky like this:
exportclassHelloWorld.ComponentComponent
Describe the solution you'd like
If you have a solution in mind, please describe it.
Use some whitelist regex to check the component's name before.
By the way, why does the component's selector allow dots in the regular expression below?
Should we dupe this against #11051? That one has to do with ng new while this has to do with ng generate, but they are both schematics related and likely have the same root cause?
@dgp1130, I think it’s best to keep these separate since this is a separate validate pattern. Unless we want to create a new master issue to track various validation issues.
Activity
alan-agius4 commentedon Mar 6, 2019
This also relates to #12868
I am not sure why a dot is allowed there, maybe @clydin knows.
clydin commentedon Mar 6, 2019
It's a valid character in an HTML element name. That regex is technically overly restrictive as well. unicode characters should be allowed.
dgp1130 commentedon May 30, 2020
Should we dupe this against #11051? That one has to do with
ng newwhile this has to do withng generate, but they are both schematics related and likely have the same root cause?alan-agius4 commentedon May 30, 2020
@dgp1130, I think it’s best to keep these separate since this is a separate validate pattern. Unless we want to create a new master issue to track various validation issues.
fix(@angular-devkit/core): `classify` string util should concat strin…
fix(@angular-devkit/core): `classify` string util should concat strin…
fix(@angular-devkit/core): `classify` string util should concat strin…
fix(@angular-devkit/core): `classify` string util should concat strin…
angular-automatic-lock-bot commentedon Aug 21, 2022
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.