Skip to content

[TwigComponent] data-model #555

@veewee

Description

@veewee

Hello,

We figured out that there is a data-model subscriber in twig components which allows you to:

<div>
    {{ component('textarea_component', {
        'data-model': 'value:someParentComponentProp'
    }) }}
</div>
<textarea>{{ value }}</textarea>

I was wondering: Why don't you just want to pass {value: someParentComponentProp} as the textarea_component attributes here?

The problem with the data-model here is that it interferes with the live components syntax of: norender|registration_form[password][first] or debounce(100)|someField.

This results in a

An exception has been thrown during the rendering of a template ("Can't get a way to read the property "norender|registration_form" in class "App\Twig\Component\SomeComponent".").

I currently don't see the value of the data-model subscriber and would suggest to remove it. But I'm sure you have a good counter argument for having it included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug Fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions