web-dave / Angular-Essentials-Training

9 stars 0 forks source link

Child Routing #8

Open web-dave opened 6 years ago

web-dave commented 6 years ago
web-dave commented 6 years ago

generate

ng g c books/book-list

web-dave commented 6 years ago

app-routing.module.ts

const routes: Routes = [
  {
    path: 'books',
    component: BooksComponent,
    children: [{
      path: '',
      component: BookListComponent
    }]
  },
  ...
];
web-dave commented 6 years ago

books.component.html

  <p>
    book works!
  </p>
  <router-outlet></router-outlet>
web-dave commented 6 years ago

Lazy loading