-
Notifications
You must be signed in to change notification settings - Fork 11.9k
generators: allow dash - in selector before a number #25164
Copy link
Copy link
Closed
Labels
area: @schematics/angularfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Description
Command
generate
Description
We use jira. Tickets always follow the schema <PROJECT>-<TICKETNUMBER> so e.g. Task-123. If we do an a/b test, we like to postfix the files that mirror the control group with the ticket, so e.g feature-task-123.component.ts. But the cli right now doesn't allow this.
See ng g c TodoItemTask123 neither the files nor the selector have the -. So task-123 is actually task123:

So what I'd like to do would be one of these:
ng g c TodoItemTask-123
ng g c TodoItemTask123 --selector app-todo-item-task-123
but both commands get rejected with Selector "app-todo-item-task-123" is invalid:

Describe the solution you'd like
I'd like if ng g c TodoItemTask-123 was allowed and generates files like:
todo-item-task-123.component.ts
^ having the dash
Describe alternatives you've considered
Renaming all the files and updating the NgModule by hand afterwards.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: @schematics/angularfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix