Skip to content

Import Module while generating Submodule with --routing uses RoutingModule #6533

@web-dave

Description

@web-dave

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [] feature request

Versions.

@angular/cli: 1.1.0
node: 6.9.4
os: win32 x64
@angular/animations: 4.1.3
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.1.0
@angular/compiler-cli: 4.1.3
@angular/language-service: 4.1.3

Repro steps.

  • I simple started a Project with ng new bar --routing
  • Then i want to generate a submodule ng g module foo --routing -m=app.modules

The log given by the failure.

Output:

  create src\app\foo2\foo-routing.module.ts
  create src\app\foo2\foo.module.ts
  update src\app\app.module.ts
  • app.module.ts:
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FooRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})

Desired functionality.

FooModule should be imported!

Mention any other details that might be useful.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions