`withOnShow` should lazy bind a new view model to the page #11

Closed
finnsson opened this Issue Aug 25, 2012 · 0 comments

Projects

None yet

1 participant

@finnsson
Owner
<div data-bind="page: {id: 'user', withOnShow: someMethod('someMethod')}"></div>

someMethod must return a function that takes a callback that takes a view model.

E.g.

function requireVM(module) {
  return function(callback) {
    require([module], function(mod) {
      callback(mod.getVM());
    });
  };
}
@finnsson finnsson closed this Aug 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment