title: Input type text binding dynamically in Angular
body: <p>I have a simple app which adds the textbox value to listbox when enter key is pressed in textbox.
  Here is my html code</p>
  
  <pre><code>&lt;input type="text" value="{{ myText }}" (keypress)="keyEvent($event)"  /&gt; 
  &lt;select multiple="multiple" &gt;
    &lt;option *ngFor="let item of itemsList"&gt;
      {{item}} 
    &lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>here is my typescript component code</p>
  
  <pre><code>export class AppComponent {
    title = `hello world app !`;
    myText ='';
    itemsList = [];constructor() { 
    }
  
    ngOnInit() {
    }
  
    keyEvent(event)
    {
      if(event.keyCode === 13)
      {
        event.preventDefault(); // Otherwise the form will be submitted
        this.itemsList.push(this.myText);
      }
    }
  </code></pre>
  
  <p>myText value is not getting updated . the value is always null.</p>
  
  <p>Please help to figure out what is that i am missing while binding myText.</p>