In this part, we create a new component which will be the main page for our app.
We start by checking in our console that we are in the correct directory:
Copy /smuportal-frontend/src/app/applications/book-management-system
Copy ng generate component bms-main-page
src/app/applications/book-management-system/book-management-system.module.ts
Copy import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from "@angular/router";
import { ListBooksComponent } from './list-books/list-books.component';
import { BmsMainPageComponent } from './bms-main-page/bms-main-page.component';
const routes: Routes = [
{
path: "",
component: BmsMainPageComponent
},
{
path: "list",
component: ListBooksComponent
},
];
@NgModule({
declarations: [ListBooksComponent, BmsMainPageComponent],
imports: [
CommonModule,
RouterModule.forChild(routes),
],
exports: [RouterModule]
})
export class BookManagementSystemModule { }
Finally, in our book management folder, we create a new file "index.ts" and add the following lines:
src/app/applications/book-management-system/index.ts
Copy export * from "./list-books"
export * from "./bms-main-page"