I am using Angular Reactive Form for the signup form.
this.personalDataForm = new FormGroup({
'name': new FormControl(null, Validators.required),
'username': new FormControl(null, Validators.required),
'address': new FormControl(null, Validators.required),
'email': new FormControl(null, [Validators.required, Validators.email]),
'mobile': new FormControl(null),
'password': new FormControl(null),
});
In this form I want it to be as when user types in the name
field similar value get auto-filled to username
field
But when a user types into the username
field, the name
field is unaffected.
Please let me know how to achieve this using Reactive Forms.