I'm currently in the process of working on a project with Angular and I want to make sure that my form components can be used for creating and updating entities seamlessly.
Let's say I have a User entity stored on a remote API, and I have a form on the frontend that allows me to create these users and send the input to the server using POST. Everything works fine so far!
The problem arises when I try to use the same form for updating. I need to populate the form fields with the existing information retrieved from the remote server through a GET request. The challenge lies in the fact that the form component loads before the Observable response containing the User entity is received from the REST request.
So, the question is: How can I pre-fill a form with data from a remote server before the form is fully loaded?