These are chat archives for canjs/canjs

11th
Sep 2017
Gregg Roemhildt
@roemhildtg
Sep 11 2017 14:58
I'm a little confused on the new binding syntax. I have a login-form componet that I want to call a method on when a link in the current template is clicked.
<li class="menu-item"><a href="#" on:el:click="logoutUser"><i class="fa fa-fw fa-sign-out"></i> Logout</a></li>

<modal-dialog title="Login" active on:vm:active="toggleLogin">              
    <login-form vm:logoutUser:to="@logoutUser" />
</modal-dialog>
But stache warns "cannot find method named logoutUser
Maybe its a scope issue
Am I setting logoutUser on my modal-dialog viewmodel? or my main view model?
Kevin Phillips
@phillipskevin
Sep 11 2017 15:54
since it's in the <content> you are setting logoutUser on your main viewmodel I would think
did this work with the old binding syntaxes?
Gregg Roemhildt
@roemhildtg
Sep 11 2017 18:00
Not sure. I've only just started looking into it.
Justin Meyer
@justinbmeyer
Sep 11 2017 21:02
@sronsiek yes, that should be enough