FormControl boolean without default value in angular 2
Change payedOvertime: [false, Validators.required]
to payedOvertime: [null, Validators.required]
.
Given that you set it to false
, it matches the value of No
radio button in the template and it selects it by default (rightly so). Setting it to null
will prevent Angular from matching the value with any of those declared in the template and thus non of those radio buttons will be selected.
Only change Validators.required
to Validators.requiredTrue
,
Something like:
payedOvertime: [false, Validators.requiredTrue]