onshore-forms 0.0.50 → 0.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/models/form.models.mjs +1 -1
- package/esm2020/lib/onshore-forms.service.mjs +7 -1
- package/fesm2015/onshore-forms.mjs +6 -0
- package/fesm2015/onshore-forms.mjs.map +1 -1
- package/fesm2020/onshore-forms.mjs +6 -0
- package/fesm2020/onshore-forms.mjs.map +1 -1
- package/lib/models/form.models.d.ts +4 -0
- package/lib/onshore-forms.service.d.ts +2 -5
- package/package.json +1 -1
|
@@ -163,17 +163,23 @@ class OnshoreFormsService {
|
|
|
163
163
|
if (subitem.type == OnshoreFormTemplateType.subform) {
|
|
164
164
|
if (item.subformArray) {
|
|
165
165
|
formControls[subitem.name] = new FormArray([]);
|
|
166
|
+
formControls[subitem.name].setParent(formControls[subitem.name]);
|
|
167
|
+
this.subscribeNestedFormArray(formControls[subitem.name]);
|
|
166
168
|
}
|
|
167
169
|
if (item.subformObject) {
|
|
168
170
|
formControls[subitem.name] = new FormGroup({});
|
|
171
|
+
this.subscribeNestedFormGroup(formControls[subitem.name]);
|
|
169
172
|
}
|
|
170
173
|
}
|
|
171
174
|
else {
|
|
172
175
|
const defaultValue = defaultValues?.find(value => value.name === subitem.name)?.value;
|
|
176
|
+
console.log("OSF - SET DEFAULT", defaultValue);
|
|
173
177
|
formControls[subitem.name] = new FormControl(defaultValue ?? (subitem.default !== undefined ? subitem.default : ''), {
|
|
174
178
|
validators: subitem.validators || [],
|
|
175
179
|
updateOn: 'change'
|
|
176
180
|
});
|
|
181
|
+
formControls[subitem.name].updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
182
|
+
console.log("OSF - FORM CONTROL VAL", formControls[subitem.name], formControls[subitem.name].value);
|
|
177
183
|
}
|
|
178
184
|
});
|
|
179
185
|
}
|