Closed frankiefu closed 10 years ago
<template id="t" bind> <div id="test" foo="{{foo1}} {{foo2}}" bar="{{bar}}"></div> </template> <script> document.addEventListener('DOMContentLoaded', function() { var model = { foo1: 'foo1Value', foo2: 'foo2Value', bar: 'barValue' }; document.getElementById('t').model = model; Platform.performMicrotaskCheckpoint(); }); </script>
If you inspect div#test you will see bar is not updated.
<div id="test" foo="foo1Value foo2Value" bar="{{bar}}"></div>
I see that in TemplateBinding.js::processBindings: https://github.com/Polymer/TemplateBinding/blob/master/src/TemplateBinding.js#L669 That for loop and the outer for loop are both using var i and that might be the reason causing the next binding to be skipped.
That's exactly the issue. Committing patch now.
https://github.com/Polymer/TemplateBinding/commit/427c58e9b19080a1f3c6ce80ea223e5e2660da0d
If you inspect div#test you will see bar is not updated.
I see that in TemplateBinding.js::processBindings: https://github.com/Polymer/TemplateBinding/blob/master/src/TemplateBinding.js#L669 That for loop and the outer for loop are both using var i and that might be the reason causing the next binding to be skipped.