Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

No documentation explaining two-way data binding inside dom-repeat #1461

Open
@mgiuffrida

Description

@mgiuffrida

I haven't found documentation explaining the difference between one-way and two-way binding in dom-repeat. Specifically, I'm trying to understand why this does not work (real example here):

<dom-module id="x-foo"><template>
  <template is="dom-repeat" items="[[items]]><!-- one-way binding of items -->
    <paper-checkbox checked="{{item.checked}}"></paper-checkbox>
  </template>
  <paper-toggle-button checked="{{items.0.checked}}"></paper-toggle-button>
</template></dom-module>

Changing the paper-checkbox doesn't affect the paper-toggle-button. If items="{{items}}" is two-way bound instead, it works.

I gather the rule is "two-way data binding to item inside dom-repeat only works if items is also two-way bound" but I'm not sure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions