title: Pass a template-defined local variable to parent component
body: <p>I'm trying to pass a local input from an input field from a child component to a parent component. Here is an example:</p>
  
  <pre><code>// Parent component export:
  itemInput: string;
  
  // Parent component template
  &lt;div&gt;
    &lt;add-item [itemInput]="itemInput"&gt;&lt;/add-item&gt;
  &lt;/div&gt;
  &lt;div [hidden]="itemInput.length &lt;= 0"&gt;
    &lt;ul&gt;
      &lt;li *ngIf="checkEntry(itemInput) == true"&gt;
        Some data here
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  
  // Child Component template
  &lt;input type="text" (keyup)="0" #itemInput [(ngModel)]="itemInput.value"&gt;
  </code></pre>
  
  <p>I'm still fairly unfamiliar with 2-way binding, but can't seem to figure it out. I understand the concept, but am still grasping the syntax for it.</p>
  
  <p>Any help is greatly appreciated. Also, if other information is needed, please let me know. Thanks</p>
  
  <p>Edit:</p>
  
  <p>Here's my error message:</p>
  
  <p>EXCEPTION: TypeError: Cannot read property 'length' of undefined in [itemInput.length &lt;= 0]</p>