web-dave / angular_workshop

0 stars 0 forks source link

Lazy Loading #5

Open web-dave opened 9 months ago

web-dave commented 9 months ago
  1. Move src/book-list folder to src/books/book-list
  2. Create new route config and move all Books related routes to this.
    books.routes.ts

Entry path is empty.

const routes: Routes = [
  {
    path: '',
    component: BooksComponent,
    children: [
      {
        path: '',
        component: BookListComponent,
      },
    ],
  },
];
export default routes;

  1. Define books route as a lazy route
app.routes.ts ```ts { path: 'books', loadChildren: () => import('./books/books.routes'), }, ```
  1. Detele all unused Imports
  2. Test it
web-dave commented 9 months ago

NEXT