Outline

Your turn to implement POST

Steps to complete:

  1. Build the HTML to allow your users to input data that you would like saved to your database through the API. Remember how we used ngModel to bind the data to our component. Don't forget to add the FormsModule to your app.module.ts imports
  2. Setup your click handler inside of your component. This is what will call your service.
  3. Create an add method that will make the POST request to your API. Remember that POST's require the item to be added so ensure that what you want to add is being passed in as an argument. Implement your POST using the BehaviorSubject so you have full control of what gets emmited from your service. You should also refactor your GET call to use the same BehaviorSubject pattern.
  4. Now it's time to see it all work. Serve up your Angular application and your API. Verify that you can add new items using your newly created POST.

If you run into trouble or just want to share what you have so far I encourage you to reach out to me. My twitter is @ThomasJDesmond and my website is TheTomBomb.com.

 

I finished! On to the next chapter