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

Connect the Edit Listing page

From the course: Angular: Creating and Hosting a Full-Stack Site

Start my 1-month free trial

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,…

Contents