From the course: Building Angular and Django Apps
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Deleting an item using Angular and Django
From the course: Building Angular and Django Apps
Deleting an item using Angular and Django
- [Instructor] To delete an item, we need to send an http request from Angular to Django. Let's update the rest API service to make that call in a delete tour method. Go to the bottom of rest API service, and we create delete tour, it accepts an ID, and then it's going to return the result of calling http client delete and its point to api v1 slash packages with the package ID that we want to delete and then we provide the olof token in the headers. Now in the tour package controller, we also need to implement a delete method. This one however will take a tour package. We're expecting that it will have an ID in that object and we're going to return the result of calling rest API service, delete tour, the tour package ID. Our tour package list component already has found the delete buttons for each package in the list to delete tour. So all we have to do is fill it in. We can call tour package controller delete…
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
-
-
-
-
-
-
-
(Locked)
Checking permissions with Django3m 20s
-
(Locked)
Deleting an item using Angular and Django2m 14s
-
(Locked)
Partially updating an item using Angular4m 9s
-
(Locked)
Pagination with Django52s
-
(Locked)
Pagination with Angular3m 29s
-
(Locked)
Filtering with Django2m 38s
-
(Locked)
Filtering with Angular1m 36s
-
(Locked)
Animations in Angular7m 23s
-
(Locked)
-
-
-