flatiron / plates

Light-weight, logic-less, DSL-free, templates for all javascript environments!
MIT License
831 stars 69 forks source link

Multiple list binding problem #52

Closed brenden closed 12 years ago

brenden commented 12 years ago

I am trying to bind an array of names to the entries in list A, but not to list B.

<div>
  <ul id="A">
    <li data-bind="names"></li>
  </ul>
  <ul id="B">
    <li></li>
  </ul>
</div>
var data = {names: ['woody allen', 'wu tang clan']};
map.where('data-bind').is('names').to('names');
plates.bind(html, data, map);

Expected output:

<div>
  <ul id="A">
    <li data-bind="names">woody allen</li>
    <li data-bind="names">wu tang clan</li>
  </ul>
  <ul id="B">
    <li></li>
  </ul>
</div>

Actual output:

<div>
  <ul id="A">
    <li data-bind="names">woody allen</li>
  </ul> 
  <ul id="B">
    <li></li>
    <li data-bind="names">wu tang clan</li>
  </ul> 
  <ul id="B">
    <li></li>
  </ul>
  <ul id="B">
    <li></li>
  </ul>
</div>

If I remove list B, the data gets bound to list A properly. Any thoughts on what is happening?

Thanks

pksunkara commented 12 years ago

Yes, this is similiar to #47. We are working on it.

pksunkara commented 12 years ago

Closed due to issue being duplicate