-
Notifications
You must be signed in to change notification settings - Fork 18
/
app-router.module.ts
37 lines (35 loc) 路 1.06 KB
/
app-router.module.ts
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
32
33
34
35
36
37
import { Routes, RouterModule } from '@angular/router';
import { WelcomeComponent } from './welcome/welcome.component';
import { ReportPageComponent } from './report/report-page/report-page.component';
import { AuthComponent } from './auth/auth.component';
import { RepositoryPageComponent } from './repository/repository-page/repository-page.component';
import { AuthenticatedGuard } from './auth/authenticated-guard';
import { NgModule } from '@angular/core';
const routes: Routes = [
{
path: 'repos/:owner',
component: RepositoryPageComponent,
canActivate: [AuthenticatedGuard],
},
{
path: 'reports',
children: [{ path: '**', component: ReportPageComponent }],
},
{ path: '', pathMatch: 'full', component: WelcomeComponent },
{
path: 'auth/:provider/callback',
pathMatch: 'full',
component: AuthComponent,
},
{ path: '**', redirectTo: '' },
];
@NgModule({
imports: [
RouterModule.forRoot(routes, {
anchorScrolling: 'disabled',
useHash: false,
}),
],
exports: [RouterModule],
})
export class AppRouterModule {}