Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.
This repository was 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

Description

@falinsin

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions