BookMonkey 4 Diff

Files changed (4) hide show
  1. tmp/src/app/book-monkey/iteration-6/{modules → lazy-loading}/admin/admin-routing.module.ts +5 -5
  2. tmp/src/app/book-monkey/iteration-6/{modules → lazy-loading}/app-routing.module.ts +9 -1
  3. tmp/src/app/book-monkey/iteration-6/{modules → lazy-loading}/app.module.ts +1 -5
  4. tmp/src/app/book-monkey/iteration-6/{modules → lazy-loading}/books/books-routing.module.ts +2 -2
tmp/src/app/book-monkey/iteration-6/{modules → lazy-loading}/admin/admin-routing.module.ts RENAMED
@@ -1,21 +1,21 @@
1
  import { NgModule } from '@angular/core';
2
  import { Routes, RouterModule } from '@angular/router';
3
   
4
- import { EditBookComponent } from './edit-book/edit-book.component';
5
  import { CreateBookComponent } from './create-book/create-book.component';
   
6
   
7
  const routes: Routes = [
8
  {
9
- path: 'admin',
10
- redirectTo: 'admin/create',
11
  pathMatch: 'full'
12
  },
13
  {
14
- path: 'admin/create',
15
  component: CreateBookComponent
16
  },
17
  {
18
- path: 'admin/edit/:isbn',
19
  component: EditBookComponent
20
  }
21
  ];
1
  import { NgModule } from '@angular/core';
2
  import { Routes, RouterModule } from '@angular/router';
3
   
   
4
  import { CreateBookComponent } from './create-book/create-book.component';
5
+ import { EditBookComponent } from './edit-book/edit-book.component';
6
   
7
  const routes: Routes = [
8
  {
9
+ path: '',
10
+ redirectTo: 'create',
11
  pathMatch: 'full'
12
  },
13
  {
14
+ path: 'create',
15
  component: CreateBookComponent
16
  },
17
  {
18
+ path: 'edit/:isbn',
19
  component: EditBookComponent
20
  }
21
  ];
tmp/src/app/book-monkey/iteration-6/{modules → lazy-loading}/app-routing.module.ts RENAMED
@@ -1,5 +1,5 @@
1
  import { NgModule } from '@angular/core';
2
- import { Routes, RouterModule } from '@angular/router';
3
   
4
  import { HomeComponent } from './home/home.component';
5
   
@@ -12,6 +12,14 @@
12
  {
13
  path: 'home',
14
  component: HomeComponent
   
   
   
   
   
   
   
   
15
  }
16
  ];
17
   
1
  import { NgModule } from '@angular/core';
2
+ import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
3
   
4
  import { HomeComponent } from './home/home.component';
5
   
12
  {
13
  path: 'home',
14
  component: HomeComponent
15
+ },
16
+ {
17
+ path: 'books',
18
+ loadChildren: () => import('src/app/book-monkey/iteration-6/lazy-loading/books/books.module').then(m => m.BooksModule)
19
+ },
20
+ {
21
+ path: 'admin',
22
+ loadChildren: () => import('src/app/book-monkey/iteration-6/lazy-loading/admin/admin.module').then(m => m.AdminModule)
23
  }
24
  ];
25
   
tmp/src/app/book-monkey/iteration-6/{modules → lazy-loading}/app.module.ts RENAMED
@@ -9,8 +9,6 @@
9
  import { HomeComponent } from './home/home.component';
10
  import { SearchComponent } from './search/search.component';
11
  import { TokenInterceptor } from './shared/token.interceptor';
12
- import { BooksModule } from './books/books.module';
13
- import { AdminModule } from './admin/admin.module';
14
   
15
  @NgModule({
16
  declarations: [
@@ -21,9 +19,7 @@
21
  imports: [
22
  CommonModule,
23
  HttpClientModule,
24
- AppRoutingModule,
25
- BooksModule,
26
- AdminModule
27
  ],
28
  providers: [
29
  { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true },
9
  import { HomeComponent } from './home/home.component';
10
  import { SearchComponent } from './search/search.component';
11
  import { TokenInterceptor } from './shared/token.interceptor';
   
   
12
   
13
  @NgModule({
14
  declarations: [
19
  imports: [
20
  CommonModule,
21
  HttpClientModule,
22
+ AppRoutingModule
   
   
23
  ],
24
  providers: [
25
  { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true },
tmp/src/app/book-monkey/iteration-6/{modules → lazy-loading}/books/books-routing.module.ts RENAMED
@@ -6,11 +6,11 @@
6
   
7
  const routes: Routes = [
8
  {
9
- path: 'books',
10
  component: BookListComponent
11
  },
12
  {
13
- path: 'books/:isbn',
14
  component: BookDetailsComponent
15
  }
16
  ];
6
   
7
  const routes: Routes = [
8
  {
9
+ path: '',
10
  component: BookListComponent
11
  },
12
  {
13
+ path: ':isbn',
14
  component: BookDetailsComponent
15
  }
16
  ];