2
私のdom-mouleでは、バインドされたデータticket.start_time
を関数への入力として使用し、関数の戻り値を表示したいとします(これは、 。バインドされたデータをポリマーの関数入力として使用する方法
今、私はバインドされたデータにアクセスする方法を知っている
<li><span>{{ticket.start_time}} has lapsed</span>
を次のように欠けている部分は、この機能を起動する方法を機能
ticket.start_time
にアクセスする方法を
- です
完全なコードは次のとおりです。
<dom-module id="todo-app">
<template>
<ul>
<template is="dom-repeat" items="[[reply.tickets]]" as="ticket">
<style>
span[done]{
text-decoration: line-through;
}
</style>
<li><span done$={{ticket.end_time}}>{{ticket.id}}: {{ticket.detail}}, {{ticket.start_time}} has lapsed</span>
</template>
</template>
</ul>
<iron-ajax
auto=true
id="requestData"
url="/data"
handleAs="json"
on-response="handleResponse">
</iron-ajax>
</template>
<script>
Polymer({
is: "todo-app",
properties: {
reply: {
type: Object
}
},
handleResponse: function (data){
this.reply= data.detail.response;
}
});
</script>
</dom-module>