|
1 | | -import { provideRouter, RouterConfig } from '@angular/router'; |
2 | | - |
| 1 | +import {Routes} from '@angular/router'; |
3 | 2 | import {About} from './about/about'; |
4 | 3 | import {Home} from './home/home'; |
5 | 4 | import {RepoBrowser} from './github/repo-browser/repo-browser'; |
6 | 5 | import {RepoList} from './github/repo-list/repo-list'; |
7 | 6 | import {RepoDetail} from './github/repo-detail/repo-detail'; |
8 | 7 |
|
9 | | -const routes: RouterConfig = [ |
10 | | - { path: '', redirectTo: 'home', terminal: true }, |
11 | | - { path: 'home', component: Home }, |
12 | | - { path: 'about', component: About }, |
13 | | - { path: 'github', component: RepoBrowser, children: [ |
14 | | - { path: ':org', component: RepoList, children: [ |
15 | | - { path: ':repo', component: RepoDetail }, |
16 | | - { path: '', component: RepoDetail } |
17 | | - ]}, |
18 | | - { path: '', component: RepoList} |
19 | | - ]} |
| 8 | +export const rootRouterConfig: Routes = [ |
| 9 | + {path: '', redirectTo: 'home', terminal: true}, |
| 10 | + {path: 'home', component: Home}, |
| 11 | + {path: 'about', component: About}, |
| 12 | + {path: 'github', component: RepoBrowser, |
| 13 | + children: [ |
| 14 | + {path: '', component: RepoList}, |
| 15 | + {path: ':org', component: RepoList, |
| 16 | + children: [ |
| 17 | + {path: '', component: RepoDetail}, |
| 18 | + {path: ':repo', component: RepoDetail} |
| 19 | + ] |
| 20 | + }] |
| 21 | + } |
20 | 22 | ]; |
21 | 23 |
|
22 | | -export const APP_ROUTER_PROVIDERS = [ |
23 | | - provideRouter(routes) |
24 | | -]; |
0 commit comments