Skip to content

[Bug] {{each}} item binding with square brackets doesn't update, when right side is an aliased attribute #582

@ericyhwang

Description

@ericyhwang

The title is long and complicated. I have a repro of the issue using Derby's component tests:
ee2e1b0

Also putting the example here:

<Body:>
  <view is="greeting-list" greetingIds="{{_page.greetingIds}}"/>

<greeting-list:>
  {{each @greetingIds as #id, #i}}
    <div>{{_page.greetings[#id]}}</div>
  {{/each}}

Doing a model.set('_page.greetingIds.0', 'foo'), I'd expect the binding to update, but it doesn't.

The binding does update properly under these other scenarios:

  1. Setting the entire array: model.set('_page.greetingIds', ['foo'])
  2. Changing the template to use the array index: {{ _page.greetings[@greetingIds[#i]] }}
  3. Changing the template to not use an attribute: {{each _page.greetingIds as #id, #i}}

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