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 committed May 22, 2023
1 parent d1090c0 commit 260b20b
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 260b20b

Please sign in to comment.