We have learned how to define a route in angular using Angular Routing. In a route we can also pass a parameter whose value can change dynamically. For example, let's say we want to display the details of a course. For that, we will have to redirect user to the CourseDetails Page.
In the Course details page, we want to display the course detail based on the ID of the course. For that, we can pass an ID parameter to the route whose value can change dynamically, and then retrive the value of that parameter from the Route and use it in our application.
The parameter which we pass to a route is called as route parameter. In this lecture you will learn:
1. What is a Route Parameter?
2. How to pass a Route parameter to a Route?
3. How to retrieve the value of Route parameter from the route.
To work with Route parameters, we also need angular to inject an instance of ActivatedRoute class.
DOWNLOAD SECTION SOURCE CODE HERE: drive.google.c...
26 авг 2024