title: Two-way binding between parent and child custom element in Aurelia
body: <p>I thought I was trying to do something very simple but I just can't make this work. This entire example is on <a href="http://plnkr.co/edit/zk709c">plunkr</a></p>
  
  <p>I have a very basic custom element that present a <code>@bindable</code> data member that it displays and monitors with a changed event. It look like this:</p>
  
  <pre><code>import {bindable} from "aurelia-framework";
  export class ChildElementCustomElement {  
    @bindable childData;  
    childDataChanged(value) {
      alert("Child Data changed " + value);
    }  
  }
  </code></pre>
  
  <p>and the view:</p>
  
  <pre><code>&lt;template&gt;
    &lt;div style="border: solid 1pt green;"&gt;
      &lt;h2&gt;This is the child&lt;/h2&gt;
      This is the child data : ${childData}
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>The parent shows the child element but I want a member in its view model that's bound to the child so any change in the parent member is automatically reflected in the child. Here's the parent code:</p>
  
  <pre><code>import {bindable} from "aurelia-framework";
  export class App {
    parentData = "this is parent data";
  }
  </code></pre>
  
  <p>and the view:</p>
  
  <pre><code>&lt;template&gt;
    &lt;h1&gt;Two-way binding between parent and child custom elements&lt;/h1&gt;
    &lt;require from="./child-element"&gt;&lt;/require&gt;  
    &lt;child-element childData.bind="parentData"&gt;&lt;/child-element&gt;  
    &lt;hr/&gt;  
    &lt;label&gt;The following is the parent data:&lt;/label&gt;
    &lt;input type="text" value.bind="parentData"&gt;&lt;/input&gt;  
  &lt;/template&gt;
  </code></pre>
  
  <p>What I'd like to see is any updates typed in the input field will automatically appear in the child (plus the changed event fires) but the child doesn't appear bound at all! I've also tried swapping <code>bind</code> for <code>two-way</code> just in case the convention has bound <code>one-way</code> but that still hasn't worked.</p>
  
  <p>Please highlight my stupidity :) because currently I'm stuck thinking this should just work.</p>