javascript - Access knockoutjs ViewModel from outside binding scope -
i have page has parent area has 2 children areas, simplified following
<div id='parent'> ....other parent's html markups .... <div id='signin'> ... signin's html markups .... </div> <div id='register'> ... register's html markups .... </div> </div>
each of 'child' divs binds own viewmodel
ko.applybindings(new signinmodel(), document.queryselector('#signin')) ko.applybindings(new registermodel(), document.queryselector('#register'))
how can bind parent's html markups outside of both children divs properties of either signin or register viewmodel ?? or have merge 2 viewmodels one, bind parent?
how can bind html markup inside 'signin' div property of signinmodel viewmodel, or otherway round?
thanks
i don't think can. have bind parent , can use data-bind span.
Comments
Post a Comment