-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathapp.routes.ts
More file actions
31 lines (30 loc) · 664 Bytes
/
app.routes.ts
File metadata and controls
31 lines (30 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { Route } from '@angular/router';
import { unsavedChangesGuard } from './guards/unsaved-changes.guard';
import { JoinComponent } from './pages/join.component';
import { PageComponent } from './pages/page.component';
export const appRoutes: Route[] = [
{
path: '',
pathMatch: 'full',
redirectTo: 'form',
},
{
path: 'form',
loadComponent: () => JoinComponent,
canDeactivate: [unsavedChangesGuard],
},
{
path: 'page-1',
data: {
title: 'Page 1',
},
loadComponent: () => PageComponent,
},
{
path: 'page-2',
data: {
title: 'Page 2',
},
loadComponent: () => PageComponent,
},
];