Invoke a function on if binding

36 views
Skip to first unread message

Abolfazl Davoodi

unread,
Aug 15, 2016, 6:14:22 AM8/15/16
to KnockoutJS
hi

I have a if binding like this:

<content data-bind="if:userInfo.isAuthenticate">
               
<div data-bind="template:'login-template'"></div>
</content>

how can I invoke a function when userInfo.isAuthenticate is true?

thanks

Gunnar Liljas

unread,
Aug 15, 2016, 6:39:11 AM8/15/16
to knock...@googlegroups.com
You don't do that in the binding, you do it in the viewmodel. If necessary, by subscribing to the isAuthenticated observable.

--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages