Situation
We have been able to pass an array from the parent screen to the template. The customAttribute
works but the historyItems
does not.
parent-template.html
<template>
<require from="./child-template"></require>
<child-template
historyItems.bind="history[0].HistoryItems"
custom-attribute.bind="history[0].HistoryItems.length">
</child-template>
</template>
child-template.html
<template>
${customAttribute}
${historyItems.length}
${historyItems}
<p repeat.for="item of historyItems">
Foobar
</p>
</template>
child-template.ts
import {autoinject, bindable} from 'aurelia-framework';
@autoinject
export class ChildTemplate {
@bindable customAttribute : string;
@bindable historyItems;
constructor() {
}
}
Question
How can we pass the historyItems
array?