Closed
Description
🚀 Feature request
Command (mark with an x
)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [X] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description
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:
export class HelloWorld.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?
Describe alternatives you've considered
Have you considered any alternative solutions or workarounds?ng generate component hello-world.component
echo D'OH!
git reset --hard
git clean -d -f
ng generate component hello-world
Anyway, I am in for a pull request.