<polymer-element name="report-card" constructor="ReportCard" attributes="cards">
<template id="example" bind syntax="MyCustom">
<span>Amount: <input value="{{ value }}">, Twice Amount: {{ 2x: value }}</span>
</template>
<script>
Polymer('report-card',{
model:{value:10},
ready:function()
{
var t = this.element.querySelectorAll('template')[0];
t.bindingDelegate = {
getBinding: function(model, path, name, node) {
// name is "bind"
var twoXPattern = /2x:(.*)/
var match = path.match(twoXPattern);
if (match == null)
return;
path = match[1].trim();
var binding = new CompoundBinding(function(values) {
return values['value'] * 2;
});
binding.bind('value', model, path);
return binding;
}
}
t.model = {
value:10
};
Platform.performMicrotaskCheckpoint();
}
});
</script>
</element>