Skip to content

trace.js complaining about $parents binding in Repeater #2351

@NordlingDev

Description

@NordlingDev

Platform: iOS
TNS: 2.0.1

The value does work, but trace.js still complains:

<Page navigatedTo="navigatedTo">

  <Repeater items="{{ photos }}">
    <Repeater.itemTemplate>
      <Label text="{{ $parents['Page'].photoWidth }}" />
      <Image src="{{ $value }}" stretch="aspectFill" class="photo" width="{{ $parents['Page'].photoWidth }}" />
    </Repeater.itemTemplate>
  </Repeater>

</page>

Label says 375 (device width). It only complains at the width property of Image. One could assume that the value might be a string, but the error says it's null:

CONSOLE ERROR file:///app/tns_modules/trace/trace.js:160:30: Binding: Property: 'photoWidth' is invalid or does not exist. SourceProperty: '$parents['Page'].photoWidth'

CONSOLE ERROR file:///app/tns_modules/trace/trace.js:160:30: Binding: Binding error while setting property width of Image(157)@file:///app/main-page.xml:10:13;: Error: Invalid value null for property width

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions