From the course: Building Angular and ASP.NET Core Applications
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Deleting data from Angular
From the course: Building Angular and ASP.NET Core Applications
Deleting data from Angular
- [Instructor] The only feature left is deleting data. So, removing a book from our collection. And that is what we are going to do now. So, let's go to visual code. In here, we are going to first create a service method. So, let's go to our service file, which is the book.service.ts and at the end, just after the updateBook, we are going to add the deleteBook method. This method is going us take us a parameter, an I'd of type number. And we are going to send the delete request. So that, we write in here return this.http.delete and then inside here, we write this.baseURL. Then inside double quotes, DeleteBook and the plus ID. Now, let us go to our delete component. And since the delete component is nearly the same like the show book component, we are going to copy the HTML from here. So let's copy the HTML and then go to the deleteBook. And we are going to paste it in here. Let us leave everything the same in here…
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
-
-
-
-
-
Angular key concepts2m 25s
-
(Locked)
Generating components and services4m 47s
-
(Locked)
Cleaning up code and updating the router7m 11s
-
(Locked)
Designing the Books page8m 10s
-
(Locked)
Reading data from Angular3m 39s
-
(Locked)
Designing the Create page9m 4s
-
(Locked)
Adding new data from Angular9m 50s
-
(Locked)
Designing the Book Details page7m 44s
-
(Locked)
Getting a single book from Angular3m 18s
-
(Locked)
Updating existing data from Angular9m 20s
-
(Locked)
Deleting data from Angular6m 45s
-
(Locked)
Handling errors in Angular12m 24s
-
-
-
-