From the course: Building Angular and ASP.NET Web API Apps

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Configuring routing in Angular

Configuring routing in Angular

From the course: Building Angular and ASP.NET Web API Apps

Start my 1-month free trial

Configuring routing in Angular

- [Instructor] To be able to navigate between different components in Angular, we need to configure routing and navigation. And to do so, we are first going to import all the necessary libraries, then we are going to configure routing, and at the end we are going to see how we can use the router outlet tag. So, let's get started. Inside the App folder, I'm going to create a new TypeScript file. I'm going to name this file app-router.module.ts. First thing first, let us import all the necessary modules. So I'm just going to write in here import then I will import the RouterModule and the Routes. We can import them both from the Angular/router library so add Angular/router. So we have the libraries. Next let us import the components because in a router, you need to configure all the components to which or from which you can navigate. So let us write in here components and then import our first component which is the Entries component. So import EntriesComponent from .entries/entries…

Contents