Skip to content

CLI does not generate suffix for components by default #30566

@aron123

Description

@aron123

Command

generate

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

19.1.0

Description

When I try to generate a new component, files are expected to have a suffix .component and class name expected to have a suffix Component.

However in version 20.0.3, these suffixes are not generated by default:

> ng g c login
CREATE src/app/login/login.spec.ts (544 bytes)
CREATE src/app/login/login.ts (193 bytes)
CREATE src/app/login/login.scss (0 bytes)
CREATE src/app/login/login.html (21 bytes)

This also applies to services. I haven't tried other sub-commands.

I use Windows 11 and Powershell 7.

Minimal Reproduction

ng new test
cd test
ng g c login

Exception or Error

Your Environment

20.0.3

Anything else relevant?

As a workaround, using the --type component option when generating the components is working.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions