Report this

What is the reason for this report?

How to save user inputs to a datasource using Angular reactive forms

Posted on March 5, 2021

I just completed the tutorial at: How To Dynamically Create Form Fields with FormArray in Angular and would like to know how to save the user inputs in a datasource. Is there a followup tutorial or would someone suggest where I can find how to do this using reactive formbuilder as in the listed tutorial? Thank you.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.

You’re on the right track with the FormBuilder and FormArray. To save your user inputs from the form into a datasource, you would typically make use of HTTP client for making POST requests to server-side databases. After the form is filled out and submitted, you can extract the data from the FormGroup and pass it to your server-side application.

While there isn’t a direct follow-up tutorial to the one you completed, I’d recommend our guide on How to Use HttpClient in Your Angular Application. This tutorial covers HTTP requests which are essential for saving user inputs in a datasource.

Please note that specifics can vary depending on the database technology you are using. Once your data reaches the server side, you will need to process it according to the requirements of your specific storage solution.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.