azproduction / rivets-backbone-adapter

Backbone.js adapter for Rivets.js data-bind with nested models and collections support
http://azproduction.github.io/rivets-backbone-adapter/example/index.html
MIT License
48 stars 15 forks source link

subscribe to root collection changes not work #3

Closed mogadanez closed 10 years ago

mogadanez commented 10 years ago
<li data-each="someCollection">
</li>
rivets.bind( el, { someCollection:someCollection })
someCollection.add( new Item() )

element not appears.

azproduction commented 10 years ago

Hello,

This is rivets's binder 'data-each' issue(It wants an Array as each argument and tries to iterate collection as array). It is impossible to fix with adapter now. Here is an Issue. This will be fixed in future version of rivets.

Right now there is 2 ways to fix it:

<li data-each="someCollection | toArray"></li>
<li data-each="fake.someCollection"></li>
mogadanez commented 10 years ago

Yes, I found the same workaround with wrapper

andriijas commented 10 years ago
<li data-each="someCollection.models"></li>