I have a stache helper in scope on a template that swaps out views when called on a can-click listener. The click binding looks like this:
<li can-click="switchView 'listView'"></li>
How can I pass a viewModel or scope property into the helper? The only arguments that seem to get passed into the helper as parameters are strings. I’d like to do this to send along any relevant data for the next view.
I’d like to do this:
<li can-click="switchView 'listView' ."></li>
But when I do, I get this:
switchView: function (viewName, obj) {
console.log(arguments);
// ['listView']
},
Any ideas? I must be misunderstanding something.
Thanks,
Alex