I have a problem updating the values of car_description.
Initially, the car_description is set to required.
But if value.car_description isn't null then I need to patch its value from the onSelectPlateNo().
and it should be disabled so you can't change it.
My problem now is that I can't submit it, since it is still required even though the values are already set.
this.serviceTransactionForm = this.formBuilder.group({
car_description: [null, Validators.required],
});
onSelectPlateNo(value) {
if (value.car_description) {
this.serviceTransactionForm.get('car_description').clearValidators();
this.serviceTransactionForm.get('car_description').setValidators(null);
this.serviceTransactionForm.get('car_description').updateValueAndValidity();
this.serviceTransactionForm.get('car_description').disable();
this.serviceTransactionForm.get('car_description').setValue(value.car_description);
} else {
this.serviceTransactionForm.get('car_description').enable();
}
}