Import Module while generating Submodule with --routing uses RoutingModule
See original GitHub issueBug 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.
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (13 by maintainers)
Top Results From Across the Web
Angular2 Routing: import submodule with routing + making it ...
The accepted answer is the best way to do it: create the routes in the module, register them externally. Thus you can modify...
Read more >Angular Routing between modules - TekTutorialsHub
The forChild method imports RouterModule but does not registers its services. Hence it should be all other modules. Example App. Create an ...
Read more >How to create module with Routing in Angular 9
Create a new Angular Application: Using the following command, ... Then add the routes to the routing.module.ts file and then import the ...
Read more >How to use modules to route and authorise users in Angular.
When you hit the route specified, it will then use its routing module to determine which component to load and voila, you have...
Read more >Lazy-loading feature modules - Angular
In the lazy-loaded module's routing module, add a route for the component. ... Create the feature module with the Angular CLI, using the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

without
=AppModuleimportsTestRoutingModuleinstead ofTestModule@web-dave @cyrilletuzi It’s work fine just 1 typo
ng g module foo --routing -m=app.moduleinstead ofng g module foo --routing -m=app.modules