Skip to content

Commit

Permalink
improved lazy imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Nov 12, 2023
1 parent af34c9a commit c035167
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {inject} from "@angular/core";
import {AuthService} from "./data/auth/auth.service";
import {NotificationService} from "@feel/notification";
import {map, skip} from "rxjs";
import mapRoutes from "./pages/map/map.routes";

const FN: CanActivateFn = route => {
const authService = inject(AuthService);
Expand Down Expand Up @@ -59,7 +60,8 @@ export const routes: Routes = [
canActivate: [FN]
},
{
path: 'map', loadChildren: () => import('./pages/map/map.routes'),
path: 'map',
children: mapRoutes,
data: {
title: $localize`Map`,
headerElement: () => import('./pages/map/map-region-selector/map-region-selector.component').then(c => c.MapRegionSelectorComponent)
Expand Down
3 changes: 1 addition & 2 deletions src/app/pages/map/map.routes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {Routes} from '@angular/router';
import {MapComponent} from './map.component';

const routes: Routes = [
{path: '', redirectTo: '0', pathMatch: 'full'},
{path: ':regionId', component: MapComponent}
{path: ':regionId', loadComponent: () => import("./map.component").then(c => c.MapComponent)}
];

export default routes;

0 comments on commit c035167

Please sign in to comment.