Web
Analytics
angular 4 routing - Tutorial

For Consultation : +91 9887575540

Stay Connected :

What is angular routing:

  • Web applications can have different sections that correspond to different URLs, and supporting those sections programmatically is called routing.
  • In Simple words, As per Url, open different angular components is called routing.
URLComponent
http://localhost:4200/homeHome.component
http://localhost:4200/aboutusAboutus.component
http://localhost:4200/contactusContactUs.Component
  • Package that must be import:

import { Routes, RouterModule } from ‘@angular/Router’;





Example:

Step1 : First Create three components home,aboutus,contactus.

Step2: Configure app.module.ts as follows.





 

Step3: Make changes in app.component.ts as follows

output:

 






Select your currency