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')) 
  1. 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?

  2. 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

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -