I have:
this.editMemberForm = this.formBuilder.group({
name: [{value: '', disabled: true}],
id: [{value: '', disabled: true}],
relType: ''
});
Then I set values to the disabled form controls:
this.editMemberForm.patchValue({
name: 'Me',
id: '000',
});
And in onSubmit():
console.log('Saving data', this.editMemberForm.value);
// { relType: '123' }
I need this.editMemberForm.value to be { name: "Me", id: '000', relType: "123" }.
You can use getRawValue() to get disabled controls values back as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With