# Use \`can-bind\` directly when not using \`can-stache-bindings\`

**URL:** <https://forums.bitovi.com/t/use-can-bind-directly-when-not-using-can-stache-bindings/1042>\
**Category:** CanJS\
**Created:** [February 19, 2019, 4:26pm UTC](https://forums.bitovi.com/t/use-can-bind-directly-when-not-using-can-stache-bindings/1042 "2019-02-19T16:26:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Mitchel](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/mike_mitchel/32/379_2.png) [@Mike\_Mitchel](https://forums.bitovi.com/u/Mike_Mitchel)\
**Post date:** [February 19, 2019, 4:26pm UTC](https://forums.bitovi.com/t/use-can-bind-directly-when-not-using-can-stache-bindings/1042/1 "2019-02-19T16:26:24Z")

</div>

I had a situation where I needed to bind a property between two observables (essentially two top level appStates) that did not have a `.stache` file associated to do the binding. I learned you can code what `can-stache-bindings` uses under the hood to wire up that parent-child binding relationship yourself. In my case, I was passing a `traceMessage` model between a viewer app (the child), where the messages were generated and added to a list, and an author app (the parent) where the list was displayed in a debug-panel. Because of this, the binding example below is from child to parent, the `.stache` equivalent of `traceMessage:to="traceMessage"`

The javascript file ‘in between them’ uses this code:

first your imports:

```auto
import Bind from 'can-bind'
import value from 'can-value'

```

the javascript code needed to set up the binding:  
(`this` is the parent/author, `rState` is the child/viewer)

```auto
    const binding = new Bind({
      parent: value.to(this, 'traceMessage'),
      child: value.from(rState, 'traceMessage')
    })

    binding.start()

```

a good memory tool for what to use for `value` for the direction is you `read from` and `write to`, in the example above i want to `read from the child` and `write to the parent`

finally, in your teardown function, for memory safe goodness:

```auto
binding.stop()

```

see the docs here for more details: [https://canjs.com/doc/can-bind.html](https://canjs.com/doc/can-bind.html)
