@@ -1,12 +1,18 @@
|
|
1 |
import { Routes } from '@angular/router';
|
2 |
|
3 |
import { HomePage } from './home-page/home-page';
|
4 |
-
import { booksPortalRoutes } from './books-portal/books-portal.routes';
|
5 |
-
import { booksAdminRoutes } from './books-admin/books-admin.routes';
|
6 |
|
7 |
export const routes: Routes = [
|
8 |
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
9 |
{ path: 'home', component: HomePage, title: 'BookMonkey' },
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
];
|
|
|
1 |
import { Routes } from '@angular/router';
|
2 |
|
3 |
import { HomePage } from './home-page/home-page';
|
|
|
|
|
4 |
|
5 |
export const routes: Routes = [
|
6 |
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
7 |
{ path: 'home', component: HomePage, title: 'BookMonkey' },
|
8 |
+
{
|
9 |
+
path: 'books',
|
10 |
+
loadChildren: () => import('./books-portal/books-portal.routes')
|
11 |
+
.then(m => m.booksPortalRoutes)
|
12 |
+
},
|
13 |
+
{
|
14 |
+
path: 'admin',
|
15 |
+
loadChildren: () => import('./books-admin/books-admin.routes')
|
16 |
+
.then(m => m.booksAdminRoutes)
|
17 |
+
}
|
18 |
];
|
@@ -3,6 +3,6 @@ import { Routes } from '@angular/router';
|
|
3 |
import { BookCreate } from './book-create/book-create';
|
4 |
|
5 |
export const booksAdminRoutes: Routes = [
|
6 |
-
{ path: '
|
7 |
-
{ path: '
|
8 |
];
|
|
|
3 |
import { BookCreate } from './book-create/book-create';
|
4 |
|
5 |
export const booksAdminRoutes: Routes = [
|
6 |
+
{ path: '', redirectTo: 'create', pathMatch: 'full' },
|
7 |
+
{ path: 'create', component: BookCreate, title: 'Create Book' }
|
8 |
];
|
@@ -4,6 +4,6 @@ import { BookList } from './book-list/book-list';
|
|
4 |
import { BookDetails } from './book-details/book-details';
|
5 |
|
6 |
export const booksPortalRoutes: Routes = [
|
7 |
-
{ path: '
|
8 |
-
{ path: '
|
9 |
];
|
|
|
4 |
import { BookDetails } from './book-details/book-details';
|
5 |
|
6 |
export const booksPortalRoutes: Routes = [
|
7 |
+
{ path: '', component: BookList, title: 'Books' },
|
8 |
+
{ path: 'details/:isbn', component: BookDetails, title: 'Book Details' },
|
9 |
];
|