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 - Angular Tutorial
From the course: Angular: Animations
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Verifying the animations package4m 50s
-
(Locked)
Project module configuration2m 4s
-
(Locked)
Application layout5m
-
(Locked)
Creating route view components5m 2s
-
(Locked)
Configuring project routes6m 5s
-
(Locked)
Challenge: Create a 404 route view24s
-
(Locked)
Solution: Create a 404 route view1m 35s
-
(Locked)
-
-
-
-
-