FarmMapsLib/src/app/app-routing.module.ts
Willem Dantuma 1991e79ed2
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
Add landingpage and lazyloading voor 3d map
2020-11-02 12:24:15 +01:00

70 lines
2.1 KiB
TypeScript

import { NgModule } from '@angular/core';
import { RouterModule, UrlSegment } from '@angular/router';
import { AuthGuard, FullScreenGuard } from '@farmmaps/common';
//import { MapComponent } from '@farmmaps/common-map';
//import { Switch2D3DComponent } from '@farmmaps/common-map3d';
import { LogoComponent } from './logo/logo.component';
import { MenuComponent } from './menu/menu.component';
import { RegisterDeviceComponent } from './registerdevice/registerdevice.component';
import { NotImplementedComponent } from '@farmmaps/common';
import { NavBarGuard } from 'projects/common/src/public-api';
import { TestComponent } from './test/test.component';
import { LandingpageComponent } from './landingpage/landingpage.component';
export function urlMatcher(url: UrlSegment[]) {
return { consumed: url };
}
const routes = [
{
path: '',
canActivate: [NavBarGuard],
component: LandingpageComponent
},
{
path: '',
component: LogoComponent,
outlet: 'header-logo'
},
{
path: '',
component: LogoComponent,
outlet: 'side-panel-logo'
},
{
path: '',
component: MenuComponent,
outlet: 'side-panel-menu'
},
{
path: 'editor/:type/item/:itemcode',
canActivate: [NavBarGuard],
component: NotImplementedComponent
},
{
path: 'viewer/:type/item/:itemcode',
canActivate: [NavBarGuard],
component: NotImplementedComponent
},
{ path: 'map', loadChildren: () => import('../../projects/common-map/src/public-api').then(m => m.AppCommonMapModule), canActivateChild: [AuthGuard], canActivate: [FullScreenGuard] },
{ path: 'map3d', loadChildren: () => import('./map3d/map3d.module').then(m => m.Map3DModule), canActivateChild: [AuthGuard], canActivate: [FullScreenGuard] },
{
path: 'registerdevice/:deviceToken',
canActivate: [FullScreenGuard],
component: RegisterDeviceComponent
},
{
path: 'test',
component: TestComponent
}
];
@NgModule({
imports: [RouterModule.forRoot(routes,
{ initialNavigation: true })], // , enableTracing: true
exports: [RouterModule]
})
export class AppRoutingModule { }