In Angular 6
(6.0.7) I'm trying to generate a component via the CLI. I type in ng g c t1-2-3-user
and get the error message Selector (app-t1-2-3-user) is invalid.
Is there something inherently not allowed in this name? I've already created a parent module called t1-myModule
via ng g module t1-myModule
and it was created successfully. Within that module is where I'm trying to generate this component.
I've tried creating a different name like ng g c t1-testComponent
and it works fine - so the CLI doesn't appear to be broken. Something about naming a component t1-2-3-user
in my setup is not liked by Angular.
EDIT: after further testing, it appears Angular doesn't like the first character after a dash -
to be a number. Possibly a similar limitation as in JavaScript variables. I assume since it gets compiled into JavaScript? Can anyone elaborate on/confirm this component naming constraint?