Consuming REST API for the Edit and Delete Functionality
Understand how to consume REST APIs for edit and delete functionality in Angular. Learn to implement update and delete methods, handle form validation, and update UI components dynamically.
We'll cover the following...
We'll cover the following...
Consuming the Edit API
To consume the REST API for the edit functionality, we implement the code below:
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
"recommendations": ["angular.ng-template"]
}
Edit course functionality.
Below is a summary of the code above:
- We start by importing Router in line 2. We then inject it into the
constructorin line 17. - In line 43, we create the
updateCourse()function. In line 44, we extract the value from theupdateFormform control through object