polymer's
template repeat
次のような機能を使用して、カスタム サブ要素をローカル ストレージの値にバインドしようとしています。
<polymer-element name="aw-outerElement">
<template>
<template repeat="{{group in grouplist}}">
<aw-innerElement groupId="{{group.groupId}}" name="{{group.name}}" val="{{group.val}}"></aw-innerElement>
</template>
</template>
<script>
Polymer('aw-outerElement', {
ready : function () {
// Binding the project to the data-fields
this.prj = au.app.prj;
this.grouplist = [
{ groupId: 100, name: 'GroupName1', val: this.prj.ke.groupVal100},
{ groupId: 200, name: 'GroupName2', val: this.prj.ke.groupVal200}
];
}
</script>
this.prj.ke.groupVal100
上記のコードでは、データ バインディングを、属性を介しthis.prj.ke.groupVal200
て内部要素に渡そうとしています。これは、value 属性をたとえば に設定する必要があるカスタム要素です。value属性内のデータバインディング文字列 ではなく、保存された初期値0のみが設定されるようです。内部要素でデータバインディングを作成する方法はありますか?aw-innerElement
val
aw-innerElement
paper-input
this.prj.ke.groupVal100
this.prj.ke.groupVal100
template repeat
私の内部要素は次のようになります。
<polymer-element name="aw-innerElement" attributes="groupId name val">
<template>
<paper-input type="number" floatingLabel label="{{groupId}} {{name}}" value="{{val}}" error="{{i18nnrerror}}"></paper-input>
</template>
<script>
Polymer('aw-innerElement', {
publish: {
groupId: 0,
name: '',
val: 0
},
ready : function () {
// Binding the project to the data-fields
this.prj = au.app.prj;
...
}
</script>
上でわかるようにvalue="{{val}}"
、私の innerElement は と に設定する必要がthis.prj.ke.groupVal100
ありthis.prj.ke.groupVal200
ます。
前もって感謝します!