We need to generate a component for our application. In our console, navigate to the book management folder that we have created earlier. Your path should look similar to:
Copy /smuportal-frontend/src/app/applications/book-management-system
Once reached, we are ready to create our component. Angular allows us to generate a component with a simple command:
Copy ng generate component list-books
We only need to define our component in the module we created.
Your book management system module should become the following:
src/app/applications/book-management-system/book-management-system.module.ts
Copy import { NgModule } from '@angular/core' ;
import { CommonModule } from '@angular/common' ;
import { RouterModule , Routes } from "@angular/router" ;
import { ListBooksComponent } from './list-books/list-books.component' ;
const routes : Routes = [
{
path : "list" ,
component : ListBooksComponent
} ,
];
@ NgModule ({
declarations : [] ,
declarations : [ListBooksComponent] ,
imports : [
CommonModule
]
})
export class BookManagementSystemModule { }
Finally, we create a new file "index.ts" in the list-books folder and add the following line:
src/app/applications/book-management-system/list-books/index.ts
Copy export * from "./list-books.component"