【发布时间】:2016-09-30 23:38:41
【问题描述】:
我正在尝试在 Aurelia 中构建自定义元素。在这一点上,这就是我所拥有的:
item.html
<template>
<span>${someProperty}</span>
</template>
item.ts
import {bindable} from 'aurelia-framework';
class Item {
@bindable someProperty: string;
}
parent.html
<template>
<require from="./item"></require>
<item repeat.for="item of items"></item>
</template>
parent.ts
class Parent {
items: Item[];
loadItems() {
// at this point, I'm sure that items is getting populated.
this.items = dataservice.loadItems();
}
}
我似乎在文档中找不到任何涉及这种情况的内容。我得到的是跨度是空的。我在控制台中没有收到任何错误。我这样做是否正确?
【问题讨论】:
标签: aurelia