to add the route, firstly open the app-routing.module.ts file.
Step1:- Now import the AddEmployeeComponent in this file.
[php]
import { AddEmployeeComponent } from ‘./add-employee/add-employee.component’;
[/php]
Step2:- After that, create the route and put into the route array.
[php]
const routes: Routes = [
{path:’add-employee’,component:AddEmployeeComponent},
];
[/php]
Step3:- Now, add the router-outlet in the app-component.html file.
[php]
<router-outlet></router-outlet>
[/php]
Step4:- After save the file then open the url http://localhost:4200/add-employee
Note:-1) Hello Employee Management Tools is coming from the app.component.html file
2) add-employee works! is coming from the add-employee.component.html file