-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-routing.module.ts
44 lines (42 loc) · 1.43 KB
/
app-routing.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
38
39
40
41
42
43
44
import { BookAuthorsComponent } from './book/book-authors/book-authors.component';
import { DvdFormComponent } from './dvd/dvd-form/dvd-form.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { BookComponent } from './book/book.component';
import { DvdComponent } from './dvd/dvd.component';
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DvdDetailComponent } from './dvd/dvd-detail/dvd-detail.component';
import { BookDetailComponent } from './book/book-detail/book-detail.component';
const appRoutes: Routes = [
{ path: 'dvds', component: DvdComponent },
{
path: 'books',
component: BookComponent,
children: [
{
path: ':index',
component: BookDetailComponent,
children: [
{ path: 'authors', component: BookAuthorsComponent }
]
},
]
},
{ path: 'electronics', loadChildren: './electronics/electronics.module#ElectronicsModule'},
{ path: 'dvds/new', component: DvdFormComponent },
{ path: 'dvds/:index', component: DvdDetailComponent },
{ path: '', pathMatch: 'full', redirectTo: 'dvds' },
{ path: '**', component: PageNotFoundComponent }
]
@NgModule({
declarations: [],
imports: [
CommonModule,
RouterModule.forRoot(appRoutes),
],
exports: [
RouterModule
]
})
export class AppRoutingModule { }