From the course: Angular: Creating and Hosting a Full-Stack Site
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Connect the New Listing page
From the course: Angular: Creating and Hosting a Full-Stack Site
Connect the New Listing page
- [Instructor] So here's what adding server requests to our new listing page will look like. Like we've done with our other pages, we're going to start off by adding a new method to our listing service. So let's go back to our listing service and the method we're going to add is going to be called create listing and it's going to take three arguments. The name of the new listing, the description of the new listing, which is going to be a string as well and the price of the new listing, which will be a number and this method is going to return an observable that calls it's callback with a listing type and then inside this method, we just have to say return this.http.post. Remember that we have to use a post request since we want to send along this extra information when we create our new listing and this post request is going to respond to the listing and the URL we want to send this request to is going to be…
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)
-
-
-