From the course: Angular: Creating and Hosting a Full-Stack Site

Unlock the full course today

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

Routes and routing in Angular

Routes and routing in Angular

From the course: Angular: Creating and Hosting a Full-Stack Site

Start my 1-month free trial

Routes and routing in Angular

- [Instructor] So right now we've got our listings page component displaying inside our application. And we'll get into actually implementing our listings page soon. But first let's take a look at how routing works in Angular. As in virtually every web application we'll want the different components and pages of the application we're going to create to be displayed as a user navigates to different routes in their browser. For example, we'll want our listings page to be displayed on our /listings route. And we'll want our my listings page to be displayed on our my-listings route. And so on and so forth. So implementing this kind of functionality in Angular is actually really simple to do. All we have to do is open up our app-routing.module.ts file here. And you see this const routes array here? Well what we need to do is add an object to this array for every route that our application needs. So in the case of our…

Contents