I am currently working in Angular 4 and have a requirement to display a form with pre-filled user data. The user should be able to change the data if needed.
onSubmit(userForm: NgForm) {
console.log("userform",userForm.value);
this.next=false;
var obj = this.storage.retrieve('loginInfo');
var userId = obj.user_id;
/* Rest of the code goes here... */
}
/* Form HTML code goes here... */
I have also implemented another form for editing the data, along with an onSubmit function to capture all field values present in the form. However, I'm facing an issue where I only get the values for fields that have been changed by the user, not the remaining fields with pre-filled data. I need to capture both the modified values and unchanged pre-filled values in the onSubmit function. Here is my code: