I want to implement a menu. Each button in menu should set the menu ID in the model. I tried to do it this way, but it doesn't work:
<a class="btn btn-primary btn-large"
data-bind="click:selectUi('menu'),visible:sessionId()!=''">
Menu
</a>
Instead the selectUi is called when the page loads.
The only possible solution which comes right now to my mind is to implement one function for each button. Is that the right way?
Wrap your function call in a function.
You could also make
selectUi
return a function.