Skip to content

Use command "ng g component com1" but generate file is empty #17183

@itning

Description

@itning

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

When I use ng g component com1 command and then

G:\ProjectData\WebstormProjects\AngularTest>ng g component com1
CREATE src/app/com1/com1.component.html (19 bytes)
CREATE src/app/com1/com1.component.spec.ts (614 bytes)
CREATE src/app/com1/com1.component.ts (267 bytes)
CREATE src/app/com1/com1.component.css (0 bytes)
UPDATE src/app/app.module.ts (472 bytes)

But something went wrong when I open com1.component.ts file.

bug1

And file property:

bug2

Using other component names does not cause this state

🌍 Your Environment

"@angular/cli": "~9.0.5",

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions