Accessing another viewmodel members

2 posts, 1 answers
  1. Answer
    Olafur
    Olafur avatar
    4 posts
    Member since:
    Aug 2013

    Posted 18 Aug 2013 Link to this post

    I'm new to the MVVM and pure javascript applications and I have a question.

    Is it possible to gain hold and access members or methods in another viewmodel to initialize it in a certain way before showing, like for example in a logout link I would like to clear the username and password etc. before showing the login view again?

    Thanks,

    *******

    Sorry, this turned out to be simple

    access a property:
    app.loginService.viewModel.set("username","");

    access a method:
    app.loginService.viewModel.onLogout();

  2. Olafur
    Olafur avatar
    4 posts
    Member since:
    Aug 2013

    Posted 18 Aug 2013 Link to this post

    Sorry, this turned out to be simple

    app.loginService.viewModel.set("username","");
    app.loginService.viewModel.onLogout();


Back to Top