]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/routing.module.ts
LP 2061136 follow-up: ng lint --fix
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / routing.module.ts
1 import {NgModule} from '@angular/core';
2 import {RouterModule, Routes} from '@angular/router';
3 import {BaseResolver} from './resolver.service';
4 import {WelcomeComponent} from './welcome.component';
5
6 /**
7  * Avoid loading all application JS up front by lazy-loading sub-modules.
8  * When lazy loading, no module references should be directly imported.
9  * The refs are encoded in the loadChildren attribute of each route.
10  * These modules are encoded as separate JS chunks that are fetched
11  * from the server only when needed.
12  */
13 const routes: Routes = [
14     { path: '',
15         component: WelcomeComponent
16     }, {
17         path: 'staff',
18         resolve : {startup : BaseResolver},
19         loadChildren: () => import('./staff/staff.module').then(m => m.StaffModule)
20     }
21 ];
22
23 @NgModule({
24     imports: [RouterModule.forRoot(routes, {
25         onSameUrlNavigation: 'reload'
26     })],
27     exports: [RouterModule],
28     providers: [BaseResolver]
29 })
30
31 export class BaseRoutingModule {}