Angular switch from lazyLoading to 'normal' loading

后端 未结 2 1042
一整个雨季
一整个雨季 2020-12-09 19:46

I am working on an Angular application that has lazy loading implemented. I tried experimenting with lazy loading but decided that I do not yet want to implement it in my ap

2条回答
  •  一生所求
    2020-12-09 20:09

    Add HqModule to your AppModule's import array and remove HqModule entry from the AppModule routing definition. Like this:

    @NgModule({
      declarations: [
        AppComponent,
      ],
      imports: [
        BrowserModule,
        HqModule, // add it
        RouterModule.forRoot([
          { path: '', redirectTo: 'store', pathMatch: 'full'},
          { path: 'store', loadChildren: 'app/store/store.module#StoreModule', pathMatch: 'prefix'}
        ])
      ],
      bootstrap: [AppComponent],
      exports: [RouterModule],
    })
    export class AppModule { }
    

提交回复
热议问题