Skip to content

Generating component with Angular CLI writes code two characters too early #7732

Closed
@artemdru

Description

@artemdru

In Angular 4, whenever I use the CLI to create a component (for example, using this command: "ng g c successAlert"), the app.module.ts file does not generate the correct code - it's as if though the code is written two characters too early. For example, if warningAlert were my last added component:

import { WarningAlertComponent } from './warningAlert/warningAlert.component';

@NgModule({
  declarations: [
    WarningAlertComponent
  ]
})

And if I were to execute in the CLI "ng g c successAlert", the app.module.ts file would be updated like so:

import { WarningAlertComponent } from './warningAlert/warningAlert.componen;
import { SuccesAlertComponent } from './success-alert/succes-alert.component't';

@NgModule({
  declarations: [
    WarningAlertCompone,
    SuccessAlertComponentnt
  ]
})

As you can see, there is an error both in the import line, and in the declarations line. This error with two characters is consistent.

If it's relevant, I'm using Sublime Text 3 and the command is being written into the Glue console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions