Skip to content
This repository has been archived by the owner on Apr 30, 2018. It is now read-only.

hideExpression remove fields from the DOM but not from the MODEL #767

Open
falinsin opened this issue Jan 18, 2018 · 0 comments
Open

hideExpression remove fields from the DOM but not from the MODEL #767

falinsin opened this issue Jan 18, 2018 · 0 comments

Comments

@falinsin
Copy link

falinsin commented Jan 18, 2018

When fields are remove from DOM due to hideExpression, its values in the model still exits and send on submit.

Using

angular-formly v8.4.1
angular-formly-templates-bootstrap version 6.5.1

¿How can I remove hidden Fields from de model or set them as null?.

Here you have an example of the problem:
http://angular-formly.com/#!/example/field-options/hide-fields

I want the checkbox state do not send in the model if checkbox is hidden.

Because if this checkbox is used for hide another third field, if we hide checkbox while is checked (using a hideExpression on it) this third field still show in the DOM which is a bit weird behavior because if checkbox is removed the third dependen field must be removed.

I have been able to observe that by simply putting null in the model the fields that are no longer in the DOM perfectly hide the dependent fields in chain

Please help to refresh model when hide fields.

Thank you in advance (sorry my bad English)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant