ManuelDeLeon / viewmodel

MVVM for Meteor
https://viewmodel.org
MIT License
205 stars 23 forks source link

Cannot resolve parent-child loop #183

Closed avalanche1 closed 8 years ago

avalanche1 commented 8 years ago

The example is a bit dumb, but I actually need this pattern in my app (it's much more convoluted in there but the pattern is the same). See repro here I get undefinederror, plus the Migration.delete error image

ManuelDeLeon commented 8 years ago

Fixed on v3.4.1

btw, the way you structure your code is very confusing. Try to simplify it a bit on future repros. Something like:

Template.parent.viewmodel 
  getChildProp: ->
    console.log @child('child').childProp()

Template.child.viewmodel
  childProp: 'childProp value'
  onRendered: ->
    @parent().getChildProp()