FarmMapsLib/src/app/app-routing.module.ts

75 lines
2.1 KiB
TypeScript
Raw Normal View History

2019-07-16 14:15:40 +00:00
import { NgModule } from '@angular/core';
import { RouterModule, UrlSegment } from '@angular/router';
2019-07-16 14:15:40 +00:00
import { AuthGuard, FullScreenGuard } from '@farmmaps/common';
//import { MapComponent } from '@farmmaps/common-map';
//import { Switch2D3DComponent } from '@farmmaps/common-map3d';
2019-11-05 16:19:33 +00:00
import { LogoComponent } from './logo/logo.component';
import { MenuComponent } from './menu/menu.component';
import { RegisterDeviceComponent } from './registerdevice/registerdevice.component';
import { NotImplementedComponent } from '@farmmaps/common';
2020-01-08 10:37:57 +00:00
import { NavBarGuard } from 'projects/common/src/public-api';
import { TestComponent } from './test/test.component';
import { LandingpageComponent } from './landingpage/landingpage.component';
2019-07-16 14:15:40 +00:00
2020-01-07 21:31:27 +00:00
export function urlMatcher(url: UrlSegment[]) {
return { consumed: url };
2020-01-07 21:31:27 +00:00
}
2019-07-16 14:15:40 +00:00
const routes = [
{
path: '',
canActivate: [NavBarGuard],
component: LandingpageComponent
},
{
path: '',
component: LogoComponent,
outlet: 'header-logo'
},
{
path: '',
component: TestComponent,
outlet: 'app-menu'
},
2020-01-07 21:31:27 +00:00
{
path: '',
component: LogoComponent,
outlet: 'side-panel-logo'
},
{
path: '',
component: MenuComponent,
outlet: 'side-panel-menu'
},
2019-11-01 14:57:50 +00:00
{
path: 'editor/:type/item/:itemcode',
canActivate: [NavBarGuard],
2019-11-08 12:48:43 +00:00
component: NotImplementedComponent
},
{
path: 'viewer/:type/item/:itemcode',
canActivate: [NavBarGuard],
2019-11-08 12:48:43 +00:00
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
}
2019-07-16 14:15:40 +00:00
];
@NgModule({
imports: [RouterModule.forRoot(routes,
2020-05-09 07:14:16 +00:00
{ initialNavigation: true })], // , enableTracing: true
2019-07-16 14:15:40 +00:00
exports: [RouterModule]
})
export class AppRoutingModule { }