You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While diving deeper into updating my app to DFB v2, it seems like one more feature does not work as expected anymore.
Still having a hard time to understand what does what exactly, but I think I hunted it down to where the logic is missing.
Creating rootFormGroup will successfully create first-level array at Exam.questions.
Then, when patching data using setObject, Exam.questions will be populated with ExamQuestionItems.
However ExamQuestionItems.answers will not be generated correctly.
DFB will generate a FormControl instead of a FormArray and ExamQuestionItems.answers value will become the first array entry.
It looks like setValuesForControls implementation misses the logic to create nested FormArrays.
Instead it falls back to using the standard formBuilder which is not able to handle the model (ExamQuestionItem) correctly.
arrayControl.push(formBuilder.group(item))
The text was updated successfully, but these errors were encountered:
oh awesome! Was working on the same today but this looks better!
I'll need to rebase tomorrow as I'm still on a custom branch for handling recursion.
Will let you know then! Did you receive my mail sent to admin@site15.ru btw? Asked about donations and freelance work!
While diving deeper into updating my app to DFB v2, it seems like one more feature does not work as expected anymore.
Still having a hard time to understand what does what exactly, but I think I hunted it down to where the logic is missing.
Assuming a model like this:
Creating rootFormGroup will successfully create first-level array at Exam.questions.
Then, when patching data using setObject, Exam.questions will be populated with ExamQuestionItems.
However ExamQuestionItems.answers will not be generated correctly.
DFB will generate a FormControl instead of a FormArray and ExamQuestionItems.answers value will become the first array entry.
It looks like setValuesForControls implementation misses the logic to create nested FormArrays.
Instead it falls back to using the standard formBuilder which is not able to handle the model (ExamQuestionItem) correctly.
The text was updated successfully, but these errors were encountered: