title: Angular - On Paste Event Get Content
body: <p>I have an angular component that allows a user to enter data into a <code>textarea</code>. There are two events tied to this <code>keydown</code> and <code>paste</code>. Both of these events trigger the same method which will try and determine the data entered.</p>
  
  <p>The issue I am having is when the data is pasted <code>paste</code>, I am getting the value of the <code>formControl</code> but its the value BEFORE the data is pasted and doesn't include what I actually just entered into the field.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;textarea 
    formControlName="multiSearch" 
    class="form-control" 
    placeholder="Enter one or more values. One per line." 
    rows="6" 
    (keydown)="keyDownFunction($event)"
    (paste)="onPaste()"&gt;
  &lt;/textarea&gt;
  </code></pre>
  
  <p><strong>Component</strong></p>
  
  <pre><code>  /**
     * If we hit enter in our text area, determine the data type
     */
    keyDownFunction(event) {
  
      // Enter Key?
      if (event.keyCode == 13) {
        this.determineDataType();
      }
    }
  
    /**
     * If we paste data in our text area, determine the data type
     */
    onPaste() {
      this.determineDataType();
    }
  
    /**
     * Using regex, determine the datatype of the data and confirm with the user.
     */
    determineDataType() {
      console.log(this.searchForm.value.multiSearch)
    }
  </code></pre>
  
  <p><strong>Question</strong>
  How can I get access to the data that is pasted into the form as soon as the <code>paste</code> event is fired and not what the value was before pasting?</p>