FarmMapsLib/src/app/app-routing.module.ts
Peter Bastiani 8d3c098f4e
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
Upgraded custom-webpack and typescript.
2021-06-16 09:15:53 +02:00

85 lines
2.3 KiB
TypeScript

import { NgModule } from '@angular/core';
import { RouterModule, UrlSegment, ExtraOptions } 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: TestComponent,
outlet: 'app-menu'
},
{
path: '',
component: TestComponent,
outlet: 'notification-menu'
},
{
path: '',
component: TestComponent,
outlet: 'help-menu'
},
{
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: 'enabledBlocking' })], // , enableTracing: true
exports: [RouterModule]
})
export class AppRoutingModule { }