From the course: Angular: Animations

Unlock the full course today

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

Configuring project routes

Configuring project routes - Angular Tutorial

From the course: Angular: Animations

Start my 1-month free trial

Configuring project routes

- [Narrator] In order to switch our view based upon user interaction, we'll employ the Routing System in Angular. This will pass information to the Router as the url string changes. And then serve up a specific view within the Router Outlet. Let's see how this works. To start with, we'll go into our module, so open up app.module.ts, and we're going to have to import both RouterModule and Routes from angular/router. We also need to go ahead, and import all of the router components that we just created in the previous lesson. So, I'm going to paste in a snippet here, which includes our HomeComponent from routes/home.component, and the same thing with Basic, Contained and AdvancedComponents. The next thing we'll do is go ahead and paste in this rather large snippet here, that goes through and creates a constant called AnimationRoutes. Because eventually, we're going to be animating these Routes. For now, though, they're just going to be static switching. So, we can data type this as…

Contents