Skip to content

generators: allow dash - in selector before a number #25164

Closed

Description

@sod

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:
CleanShot 2023-05-08 at 13 48 53@2x

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:
CleanShot 2023-05-08 at 13 46 29@2x

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.

Activity

  1. added
    freq1: low
    on May 8, 2023
  2. sumitparakh commented on May 9, 2023

    @sumitparakh

    Hi @alan-agius4. I would like to take this up

  3. alan-agius4 commented on May 9, 2023

    @alan-agius4
    Collaborator

    @sumitparakh go for it.

  4. added 12 commits that reference this issue on May 20, 2023
    eb464f1
    fdebed0
    80abd64
    5fe6cff
    b3d50ef
    d3c645e
    4dc8705
    d6c4610
    98bbc0f
    55392c4
    a7e1943
    6c4c56e
  5. added 3 commits that reference this issue on Oct 26, 2023
    c5827d4
    75b7491
    2b91472
  6. angular-automatic-lock-bot commented on Nov 26, 2023

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @schematics/angularfreq1: lowseverity3: brokentype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions