Setting up the Activated Route to Update a Course
Learn to configure the ActivatedRoute in Angular.
Configuring the ActivatedRoute
The ActivatedRoute
is an API that holds observable data about a route related to a component loaded in an outlet. To implement ActivatedRoute
, we follow the steps below:
Step 1: Implement routing and navigation
We start by opening the course-list.component.html
file, and then in the edit icon tag, we create a click event handler called editCourse()
, which contains a parameter of the courseId
. In the code widget below, we have the (click)
event handler that contains the editCourse
function in line 30.
Get hands-on with 1400+ tech skills courses.