In this video, learn how to declare route parameters and access them within components.
to get information about the currently activated route … through a service of type ActivatedRoute. … Getting to that information is just … a constructor injection away. … let's add an import statement to bring in … from other methods in the class, … naming it ActivatedRoute, … The ActivatedRoute service has a property named ParamMap … that contains the route parameters … That means that we can subscribe to it … and get notified any time the set of route params changes. … So in the ngOnInIt method we can remove the existing logic … and replace it with a call to … this.activatedRoute.paramMap.subscribe … We want to give this a function … so we will use an arrow function here … and name the parameter paramMap … then the arrow, … and then the function body. … We actually need to do two things here: … We want to call the getMediaItems class method. … But before we can do that, … we need to do some normalization to the medium first. … So we created a default route that would end up … having the medium set to the string value all. …
- What is Angular?
- Working with components
- Binding events and properties
- Getting data to components
- Using directives and pipes
- Creating Angular forms
- Validating form data
- How Angular does dependency injection
- Making HTTP calls
- Styling components
Skill Level Intermediate
Angular: Building an Interfacewith Ray Villalobos2h 20m Intermediate
1. Architecture Overview
3. Directives and Pipes
5. Dependency Injection and Services
8. Styling Components
Next steps1m 20s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.