gmac / backbone.epoxy

Declarative data binding and computed models for Backbone
http://epoxyjs.org
MIT License
615 stars 89 forks source link

Cannot use another view inside itemview #123

Closed dharchouhan closed 8 years ago

dharchouhan commented 9 years ago

I have one view ParentView which has collection. I created ItemView1 for collections and it is working fine. Now this collection contains object which itself contain another collection(apart from other attributes). So i create separate view(AnotherView). Inside AnotherView template i try to populate collections. For nested collection i create another AnotherItemView. My model looks like model

  id,
  name,
  collection: [(this is collection of model Model1)
     {
         id,
         collection:[
               (this is collection of model Model2)
        ]
     }

 ]

View workflow is like

ParentView 
  ->  ItemView1 
       -> AnotherView 
           -> AnotherItemView

When epoxy applybinding in AnotherItemView template it looks for collection property inside model which is associated with ItemView1(Model1) and not with AnotherItemView(Model2).

How can i configure AnotherView so that it looks for proper model when it applybinding for collection.

gmac commented 8 years ago

Well... yeah. A collection binding within a collection binding was never planned for. The library would need a v2.0 rewrite to accommodate that scaled of a feature. Anyone interested? I don't have the bandwidth to work on software projects outside of my project needs these days.

boussou commented 8 years ago

@dharchouhan if you can provide a jsbin I can help