Skip to content

Commit

Permalink
Dynamic form : fix number default value #2540
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia authored and camillemonchicourt committed Aug 23, 2023
1 parent 5696e5d commit 7eb4d2d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ export class DynamicFormService {
createControl(formDef): AbstractControl {
const formControl = new UntypedFormControl();
const value = formDef.value || null;
this.setControl(formControl, formDef, value);
const defaultValue = parseFloat(value) ? parseFloat(value) : value;
this.setControl(formControl, formDef, defaultValue);
return formControl;
}

addNewControl(formDef, formGroup: UntypedFormGroup) {
//Mise en fonction des valeurs des dynamic-form ex: "hidden: "({value}) => value.monChamps != 'maValeur'""
for (const keyParam of Object.keys(formDef)) {
Expand Down

0 comments on commit 7eb4d2d

Please sign in to comment.