Angular CLI: 1.5.0
Node: 8.9.1
OS: win32 x64
Angular: 5.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.3
typescript: 2.4.2
webpack: 3.8.1
ng g component content/barThis bug appear when I write command ng g component, angular-cli append component to declarations incorrectly, because I use an indent to view the hierarchy of components:
@NgModule({
declarations: [
// Directives
FooDirective,
BarDirective,
// Pipes
FooPipe,
BarPipe,
// Components
AppComponent,
ContentComponent,
FooComponent,
BazzComponent,
,
BarComponentBazComponent,
],
imports: [
<...>
],
providers: [
<...>
],
bootstrap: [AppComponent]
})
export class AppModule { }
or it can be so:
@NgModule({
declarations: [
// Directives
FooDirective,
BarDirective,
// Pipes
FooPipe,
BarPipe,
// Components
AppComponent,
ContentComponent,
FooComponent,
BazzComponent,
BazCompone,
BarComponentnt,
],
imports: [
<...>
],
providers: [
<...>
],
bootstrap: [AppComponent]
})
export class AppModule { }
I need correctly to append components to the declarations.
In version 1.3.2, everything worked correctly, but in version 1.5.0 I should correct bug result every times. Please fix this bug!
@Brocco seems like this is similar to the pos vs getStart() problem we had in imports? Maybe not.
I've got this same issue, though I'm not doing any special indenting. I also have a similar issue with imports where it's taking the last 2 characters of the line and putting them on the end of the new line, like so:
import { PersonService } from './people/person.servic;
import { RoleComponent } from './people/person/role.component'e';
(e' on line 2 should be at the end of line 1)
I'm also having the same issue as @hahn-kev in version 1.6. In addition to the import statment appending the last 2 characters of the previous line to the next import statement, I'm also having the same issue with the same generated components declarations statement within that module file.
declarations: [
DashboardCompone,
TestComponentnt
],
Having the same issue as @jd21daugherty and @hahn-kev !
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._
Most helpful comment
I'm also having the same issue as @hahn-kev in version 1.6. In addition to the import statment appending the last 2 characters of the previous line to the next import statement, I'm also having the same issue with the same generated components declarations statement within that module file.
declarations: [ DashboardCompone, TestComponentnt ],