This is part 9 of the Angular tutorial for Beginners series.
- Part 1: Getting started with Angular
- Part 2: Modules, Components & Directives in Angular
- Part 3: Data binding in angular
- Part 4: Interfaces
- Part 5: Services in Angular
- Part 6 discussed Observables & Http requests.
- Part 7 discussed how we can transform our output data with pipes
- Part 8 discussed how we can create nested components in Angular.
Let’s learn about routing in Part 9 of the Angular tutorial for Beginner series.
Initially when we created our project, Angular asked if we wanted to add routing. We said yes. Angular then created the app-routing.module.ts for us. It imported the RouterModule from @angular/router. This exposes the routing service and we can use routing directives. It also exposes the configured routes. We have also called the routing module for the root method. We later pass our routes here at the root level.

Angular also imported AppRoutingModule in the app.module.ts for us,

We will also find that a router-outlet has been added in the app.component.html.

These are the changes that angular made for us when we asked it to add to routing. Now let’s have a look at how we can use them.






Sundaram SubramanianPosted Aug 12, 2019, 6:26 AM
Well written, thanks for sharing
Krishan DuttPosted Jul 1, 2019, 7:07 AM
Very good article !!!
Amit MohantyPosted Jun 28, 2019, 1:44 AM
Good description !!!