Skip to content

Instantly share code, notes, and snippets.

@armanozak
Created January 28, 2021 11:14
Show Gist options
  • Save armanozak/43a49cbbe19d0a3d987b0ac968a96fd4 to your computer and use it in GitHub Desktop.
Save armanozak/43a49cbbe19d0a3d987b0ac968a96fd4 to your computer and use it in GitHub Desktop.
[How to Configure Angular Modules Loaded by the Router] Configuring eager-loaded child module in root module #blog #angular
// other imports are removed for brevity
import { FooModule } from "./foo.module";
@NgModule({
imports: [
BrowserModule,
RouterModule.forRoot([
{
path: "",
loadChildren: () => FooModule.asChild("bar"),
}
])
],
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