<polymer-element name="my-element" attributes="bar">
<template>
<template repeat="{{ foo in bar }}">
<input value="{{ setC(foo, foo.a + foo.b) }}"/>
<input value="{{ foo.c }}"/>
</template>
</template>
<script>
Polymer('my-element', {
setC: function (f, v) {
f.c = v;
return f.c;
}
});
</script>
</polymer-element>
...
window.addEventListener('polymer-ready', function (e) {
var el = document.createElement('my-element');
el.bar = [
{
a: 1,
b: 2,
c: null
},
{
a: 3,
b: 4,
c: null
}
];
document.body.appendChild(el);
});