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
I have thoroughly enjoyed using Formly. Thanks for the continuous support guys. @aitboudad
Question
I have a formly form having multiple fields, out of which one is a which has multiple mat-autocomplete fields inside that. We can add (more fields through the add() method) and remove the added fields through remove(i) method from FieldArrayType class. This part is working fine.
Now, I want to add/delete items inside this mat-expansion panel based on some changes in the other field.
When the condition is satisfied, I am clearing the mat-expansion-panel field (formArray) form-control like below:
field 1 => which is getting changed
field 2 => this needs to be reset when field 1 is changed
When I update field 1, nothing is reflected in field 2. So basically if there are 3 items added previously, it stays like this. But when I try to add item after updating field 1, it suddenly shows only 1 item present, which is expected. I guess there is some trigger missing for the mat-expansion-panel field.
aghosh-evertz
changed the title
Mat-expansion-panel not listening to the model updates or the Form Control updates
Mat-expansion-panel not listening to the model updates or the Form Control updates from a formly field
Mar 27, 2024
I have thoroughly enjoyed using Formly. Thanks for the continuous support guys.
@aitboudad
Question
I have a formly form having multiple fields, out of which one is a which has multiple mat-autocomplete fields inside that. We can add (more fields through the add() method) and remove the added fields through remove(i) method from FieldArrayType class. This part is working fine.
Now, I want to add/delete items inside this mat-expansion panel based on some changes in the other field.
When the condition is satisfied, I am clearing the mat-expansion-panel field (formArray) form-control like below:
field 1 => which is getting changed
field 2 => this needs to be reset when field 1 is changed
When I update field 1, nothing is reflected in field 2. So basically if there are 3 items added previously, it stays like this. But when I try to add item after updating field 1, it suddenly shows only 1 item present, which is expected. I guess there is some trigger missing for the mat-expansion-panel field.
For reference. this is the field 2 template:
The text was updated successfully, but these errors were encountered: