# How can I passa viewModel or Scope property into a stache helper?

**URL:** <https://forums.bitovi.com/t/how-can-i-passa-viewmodel-or-scope-property-into-a-stache-helper/416>\
**Category:** CanJS\
**Created:** [September 23, 2016, 9:37pm UTC](https://forums.bitovi.com/t/how-can-i-passa-viewmodel-or-scope-property-into-a-stache-helper/416 "2016-09-23T21:37:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![foundling](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@foundling](https://forums.bitovi.com/u/foundling)\
**Post date:** [September 23, 2016, 9:37pm UTC](https://forums.bitovi.com/t/how-can-i-passa-viewmodel-or-scope-property-into-a-stache-helper/416/1 "2016-09-23T21:37:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eben\_roux](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/eben_roux/32/380_2.png) [@eben\_roux](https://forums.bitovi.com/u/eben_roux)\
**Post date:** [September 26, 2016, 10:52am UTC](https://forums.bitovi.com/t/how-can-i-passa-viewmodel-or-scope-property-into-a-stache-helper/416/2 "2016-09-26T10:52:30Z")

</div>

Hi Alex,

I don’t know if you’ve managed to get sorted but have you taken a look at this:

[https://canjs.com/docs/can.stache.key.html](https://canjs.com/docs/can.stache.key.html)

Seems as though **%viewModel** may do the trick. Also, the binding syntax ([https://canjs.com/docs/can.view.bindings.html](https://canjs.com/docs/can.view.bindings.html)) has been changed somewhat but I guess that would depend on your version of canjs.

Eben
