New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
1 participant
@finnsson
Owner

finnsson commented Aug 25, 2012

<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