Angular 2 edit bound value on paste only works at certain times
<p>I using Angular 2.0.0-rc.1 and am trying to build a simple component which encapsulates the behavior of a an input field which only allows integer values. (HTML5 input type=number will not work for me in this case).</p>

<p>I've managed to get the component to block non-digit keys as they are pressed. I want to do the same for pasted values but only manages to make it work occasionally. I've thrown together a Typescript Plunker which illustrates the problem: <a href="https://plnkr.co/edit/6H2iSs55yNyA2TQWqKlb" rel="nofollow">https://plnkr.co/edit/6H2iSs55yNyA2TQWqKlb</a>.</p>

<p>Any tips are greatly appreciated!</p>

<pre><code>import{ Component } from '@angular/core'

@Component({
  selector: 'my-app',
  providers: [],
  template: `
    &lt;div&gt;
    &lt;p&gt;
    Typing values into the input field successfully filters out non-digit characters. Pasting non-digit characters should clear the input but only does so occasionally, why?
    &lt;/p&gt;
    &lt;p&gt;
    Try pasting a non-digit string into the input. Works right? Now past the same value again. *sad face*
    &lt;/p&gt;
      &lt;input type="text" [ngModel]="value" (ngModelChange)="onValueChange($event)" (paste)="onPaste($event)" (keypress)="onKeyPress($event)" &gt;
      &lt;ul&gt;
        &lt;li *ngFor="let item of items"&gt;{{item}}&lt;/li&gt;
      &lt;/ul&gt;  
    &lt;/div&gt;
  `
})
export class App {
  public value: number = 42;
  public items = [];
  private _isPasting = false;

  onKeyPress(event: KeyboardEvent) {
      let char = String.fromCharCode(typeof event.charCode === 'undefined' ? event.keyCode : event.charCode);
      let match = this.isInteger(char);
      if (!match) {
          event.preventDefault();
      }
  }

  onPaste(value) {
    this._isPasting = true;
  }

  onValueChange(value) {
    if(this._isPasting &amp;&amp; !this.isInteger(value)) {
      this.value = '';
    } else {
      this.items.push(value);
    }
    this._isPasting = false;
  }

  isInteger(value: string): boolean {
    return /^\d+$/.test(value);
  }
}
</code></pre>