I'm using Angular 2 Reactive Form. I have a form Control which is defined with required validation. When the user loads the form and this control is populated Angular consider the form control as valid. (Which is good!)
However, if the form control is populated and it's also disabled angular consider it as invalid? (W-H-Y?)
Have anyone encountered this? Is this a bug or by design?
Thanks!
This is by design, as per the W3C standard disabled inputs are not valid. In Angular you can use FormGroup.getRawValues()
if you want to retrieve all values regardless of whether they are disabled or not.
Alternatively consider using the readonly
attr instead.