Updating Users
Explore how to update user data in a MongoDB database integrated with the MEAN stack. This lesson guides you through capturing user input with Angular's ngModel, linking frontend events to service calls, and handling back-end updates. You will learn to edit user details from the interface and understand the full process from UI interaction to server communication.
While implementing the reading users feature, you may have noticed that each div we created for every element of users array had a (click) attribute assigned to it.
It defined that the function setEditUser() will be called once a certain row has been clicked.
setEditUser()
This function will map that information from clicked row to the field editUser. This information is mapped to the next section of the screen, using [(ngModel)]: