|
1 | | -import { NgModule, Component } from '@angular/core'; |
2 | | -import { Routes, RouterModule } from '@angular/router'; |
3 | | -import { DashboardComponent } from './views/dashboard/dashboard/dashboard.component'; |
4 | | -import { MineApplikationerComponent } from './views/mine-applikationer/mine-applikationer/mine-applikationer.component'; |
5 | | -import { EditApplicationComponent } from './views/mine-applikationer/edit-application/edit-application.component'; |
6 | | -import { ListApplicationsComponent } from './views/mine-applikationer/list-applications/list-applications.component'; |
7 | | -import { ApplicationComponent } from './views/mine-applikationer/application/application.component'; |
8 | | -import { IoTDeviceComponent } from './views/alle-iot-enheder/iot-device/iot-device.component'; |
9 | | -import { EditIotDeviceComponent } from './views/alle-iot-enheder/edit-iot-device/edit-iot-device.component'; |
10 | | -import { MineLoraGatewaysComponent } from './views/administration-gateway/mine-lora-gateways/mine-lora-gateways.component'; |
11 | | -import { ListLoraGatewayComponent } from './views/administration-gateway/list-lora-gateway/list-lora-gateway.component'; |
12 | | -import { EditGatewayComponent } from './views/administration-gateway/edit-gateway/edit-gateway.component'; |
13 | | -import { GatewayComponent } from './views/administration-gateway/gateway/gateway.component'; |
14 | | -import { DatatargetListComponent } from './views/datatarget/datatarget-list/datatarget-list.component'; |
15 | | -import { DatatargetEditComponent } from './views/datatarget/datatarget-edit/datatarget-edit.component'; |
16 | | -import { DatatargetComponent } from './views/datatarget/datatarget/datatarget.component'; |
17 | | - |
18 | | -const routes: Routes = [ |
19 | | - { path: 'home', component: DashboardComponent }, |
20 | | - { path: 'mine-applikationer', component: MineApplikationerComponent, |
21 | | - children: [ |
22 | | - { path: '', component: ListApplicationsComponent }, |
23 | | - { path: 'application/:id', |
24 | | - children: [ |
25 | | - { path: '', component: ApplicationComponent }, |
26 | | - { path: 'edit-iot-device', component: EditIotDeviceComponent,}, |
27 | | - { path: 'edit-iot-device/:deviceId', component: EditIotDeviceComponent,}, |
28 | | - { path: 'iot-device/:deviceId', component: IoTDeviceComponent, }, |
29 | | - { path: '', component: ApplicationComponent, |
30 | | - |
31 | | - }, |
32 | | - { |
33 | | - path: 'edit-iot-device', |
34 | | - component: EditIotDeviceComponent, |
35 | | - }, |
36 | | - { |
37 | | - path: 'edit-iot-device/:deviceId', |
38 | | - component: EditIotDeviceComponent, |
39 | | - }, |
40 | | - { |
41 | | - path: 'iot-device/:deviceId', |
42 | | - component: IoTDeviceComponent, |
43 | | - }, |
44 | | - { |
45 | | - path: 'datatarget-list/:name', |
46 | | - children: [ |
47 | | - { path: '', component: DatatargetListComponent}, |
48 | | - { path: 'datatarget-edit', component: DatatargetEditComponent}, |
49 | | - { path: 'datatarget-edit/:datatargetId', component: DatatargetEditComponent}, |
50 | | - { path: 'datatarget/:datatargetId', component: DatatargetComponent} |
51 | | - ] |
52 | | - |
53 | | - } |
54 | | - ], |
55 | | - }, |
56 | | - { path: 'edit-application', component: EditApplicationComponent,}, |
57 | | - { path: 'edit-application/:id', component: EditApplicationComponent,}, |
58 | | - ], |
59 | | - }, |
60 | | - { path: 'mine-lora-gateways', component: MineLoraGatewaysComponent, |
61 | | - children: [ |
62 | | - { path: '', component: ListLoraGatewayComponent}, |
63 | | - { path: 'edit-gateway/:id', component: EditGatewayComponent}, |
64 | | - { path: 'edit-gateway', component: EditGatewayComponent}, |
65 | | - { path: 'gateway/:id', component: GatewayComponent} |
66 | | - ], |
67 | | - |
68 | | - }, |
69 | | - { path: 'datatarget', component: DatatargetListComponent }, |
70 | | - { path: '', redirectTo: '/home', pathMatch: 'full' }, |
71 | | - { path: '**', redirectTo: '/home', pathMatch: 'full' }, |
72 | | -]; |
73 | | - |
74 | | -@NgModule({ |
75 | | - imports: [RouterModule.forRoot(routes)], |
76 | | - exports: [RouterModule], |
77 | | -}) |
78 | | -export class AppRoutingModule {} |
| 1 | +import { NgModule, Component } from '@angular/core'; |
| 2 | +import { Routes, RouterModule, PreloadAllModules } from '@angular/router'; |
| 3 | +import { DashboardComponent } from './views/dashboard/dashboard/dashboard.component'; |
| 4 | +import { EditApplicationComponent } from './my-applications/edit-application/edit-application.component'; |
| 5 | +import { ListApplicationsComponent } from './my-applications/list-applications/list-applications.component'; |
| 6 | +import { ApplicationComponent } from './my-applications/application/application.component'; |
| 7 | +import { IoTDeviceComponent } from './views/alle-iot-enheder/iot-device/iot-device.component'; |
| 8 | +import { EditIotDeviceComponent } from './views/alle-iot-enheder/edit-iot-device/edit-iot-device.component'; |
| 9 | +import { MineLoraGatewaysComponent } from './views/administration-gateway/mine-lora-gateways/mine-lora-gateways.component'; |
| 10 | +import { ListLoraGatewayComponent } from './views/administration-gateway/list-lora-gateway/list-lora-gateway.component'; |
| 11 | +import { EditGatewayComponent } from './views/administration-gateway/edit-gateway/edit-gateway.component'; |
| 12 | +import { GatewayComponent } from './views/administration-gateway/gateway/gateway.component'; |
| 13 | +import { DatatargetListComponent } from './views/datatarget/datatarget-list/datatarget-list.component'; |
| 14 | +import { DatatargetEditComponent } from './views/datatarget/datatarget-edit/datatarget-edit.component'; |
| 15 | +import { DatatargetComponent } from './views/datatarget/datatarget/datatarget.component'; |
| 16 | +import { ProfilesComponent } from './profiles/profiles.component'; |
| 17 | +import { AlleIotEnhederComponent } from './views/alle-iot-enheder/alle-iot-enheder/alle-iot-enheder.component'; |
| 18 | +import { MyApplicationsComponent } from './my-applications/my-applications.component'; |
| 19 | + |
| 20 | +const routes: Routes = [ |
| 21 | + { path: 'home', component: DashboardComponent }, |
| 22 | + { |
| 23 | + path: 'my-applications', component: MyApplicationsComponent, |
| 24 | + children: [ |
| 25 | + { path: '', component: ListApplicationsComponent }, |
| 26 | + { |
| 27 | + path: 'application/:id', |
| 28 | + children: [ |
| 29 | + { path: '', component: ApplicationComponent }, |
| 30 | + { path: 'edit-iot-device', component: EditIotDeviceComponent, }, |
| 31 | + { path: 'edit-iot-device/:deviceId', component: EditIotDeviceComponent, }, |
| 32 | + { path: 'iot-device/:deviceId', component: IoTDeviceComponent, }, |
| 33 | + { |
| 34 | + path: '', component: ApplicationComponent, |
| 35 | + |
| 36 | + }, |
| 37 | + { |
| 38 | + path: 'edit-iot-device', |
| 39 | + component: EditIotDeviceComponent, |
| 40 | + }, |
| 41 | + { |
| 42 | + path: 'edit-iot-device/:deviceId', |
| 43 | + component: EditIotDeviceComponent, |
| 44 | + }, |
| 45 | + { |
| 46 | + path: 'iot-device/:deviceId', |
| 47 | + component: IoTDeviceComponent, |
| 48 | + }, |
| 49 | + { |
| 50 | + path: 'datatarget-list/:name', |
| 51 | + children: [ |
| 52 | + { path: '', component: DatatargetListComponent }, |
| 53 | + { path: 'datatarget-edit', component: DatatargetEditComponent }, |
| 54 | + { path: 'datatarget-edit/:datatargetId', component: DatatargetEditComponent }, |
| 55 | + { path: 'datatarget/:datatargetId', component: DatatargetComponent } |
| 56 | + ] |
| 57 | + |
| 58 | + } |
| 59 | + ], |
| 60 | + }, |
| 61 | + { path: 'edit-application', component: EditApplicationComponent, }, |
| 62 | + { path: 'edit-application/:id', component: EditApplicationComponent, }, |
| 63 | + ], |
| 64 | + }, |
| 65 | + { |
| 66 | + path: 'mine-lora-gateways', component: MineLoraGatewaysComponent, |
| 67 | + children: [ |
| 68 | + { path: '', component: ListLoraGatewayComponent }, |
| 69 | + { path: 'edit-gateway/:id', component: EditGatewayComponent }, |
| 70 | + { path: 'edit-gateway', component: EditGatewayComponent }, |
| 71 | + { path: 'gateway/:id', component: GatewayComponent } |
| 72 | + ], |
| 73 | + |
| 74 | + }, |
| 75 | + { path: 'datatarget', component: DatatargetListComponent }, |
| 76 | + { path: 'iot-devices', component: AlleIotEnhederComponent }, |
| 77 | + { path: 'profiles', loadChildren: () => import('./profiles/profiles.module').then(m => m.ProfilesModule) }, |
| 78 | + { path: '', redirectTo: '/home', pathMatch: 'full' }, |
| 79 | + { path: '**', redirectTo: '/home', pathMatch: 'full' }, |
| 80 | +]; |
| 81 | + |
| 82 | +@NgModule({ |
| 83 | + imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })], |
| 84 | + exports: [RouterModule], |
| 85 | +}) |
| 86 | +export class AppRoutingModule { } |
0 commit comments