From the course: Angular: Creating and Hosting a Full-Stack Site
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Connect the Edit Listing page
From the course: Angular: Creating and Hosting a Full-Stack Site
Connect the Edit Listing page
- [Narrator] Okay, so we've come to the last page that we need to hook up to our server. And that is the edit listing page. So here's what connecting to the server is going to look like. As usual, we're going to start off by creating a new method in our Listing Service. We're going to call this one edit listing. And we're going to pass the ID of the listing that we want to change, as well as the updated name, description, and price of the listing that we filled out in the inputs. And this will return an observable that calls its callback with a listing. And then inside this method, we're going to say return this dot HTTP dot post. And this request will respond with a listing. And for the URL that we want to send it to, that's going to be slash API slash listings, slash ID and for the request body we're going to pass along our name, description, and price, as well as the HTTP options. And now that we have that,…
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)
Services in Angular5m 53s
-
(Locked)
RxJS and the Angular HttpClient4m 59s
-
(Locked)
Avoid CORS errors4m 10s
-
(Locked)
Connect the Listing Detail page8m 57s
-
(Locked)
Connect the My Listings page4m 34s
-
(Locked)
Connect the New Listing page4m 2s
-
(Locked)
Connect the Edit Listing page4m 30s
-
(Locked)
-
-
-