Created
January 28, 2021 10:45
-
-
Save armanozak/a516526e2d66d57af906def20637805a to your computer and use it in GitHub Desktop.
[How to Configure Angular Modules Loaded by the Router] Lazy-loading a module via router #blog #angular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove FooModule from imports | |
@NgModule({ | |
imports: [ | |
BrowserModule, | |
RouterModule.forRoot([ | |
{ | |
path: "", | |
loadChildren: () => import('./foo.module').then(m => m.FooModule), | |
} | |
]) | |
], | |
declarations: [AppComponent], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment