In this video, learn how to send data to update through HTTP calls using the HttpClient service and the POST, PUT, and DELETE methods.
- [Instructor] Using the Angular HttpClient post … and delete methods are similar … to how you use the get method. … Let's update the mediaItems service class … to make post and delete calls … using the HttpClient service. … For the add call, … we are going to return a call to http.post. … The post method takes in a URL string … as the first parameter, … so we set that to the mediaItems URL … that the mock backend supports. … The second parameter is the body of the post. … The HTTP client methods support passing different data types … to them and they will auto detect the content type … and handle setting the content type header, … so we can pass in the mediaItem as is … and the underlying code … will detect it as an object … and set the content type header to application/json. … Now we can switch over … to the media-item-form.component.ts file. … And we can refactor the onSubmit method. … This is already calling the mediaItemService.add method … which prepares the observable … but we need to subscribe …
- What is Angular?
- Working with components
- Binding events and properties
- Getting data to components
- Using directives and pipes
- Creating Angular forms
- Validating form data
- How Angular does dependency injection
- Making HTTP calls
- Styling components
Skill Level Intermediate
Angular: Building an Interfacewith Ray Villalobos2h 20m Intermediate
1. Architecture Overview
3. Directives and Pipes
5. Dependency Injection and Services
8. Styling Components
Next steps1m 20s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.