I have a reactive form. One field is disabled, so how do i get that value from the form in controller? Writing the the FormGroup to console it doesnt display the disabled field at all, even tho it's displayed in the view.
If you set disabled to true when you set up this control in your component class, the disabled attribute will actually be set in the DOM for you. We recommend using this approach to avoid 'changed after checked' errors. Example: form = new FormGroup({ first: new FormControl({value: 'Nancy', disabled: true}, Validators.
Use the FormGroup's getRawValue()
to include control values regardless of enable/disable state.
More information in the API documentation
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