title: How to create a paste event after preventDefault?
body: <p>I'm using angular 4 and trying to work with on contenteditable</p>
  
  <pre><code>&lt;div contenteditable='true' id='editor' [innerHtml]='data'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I need to detect paste event and then manipulate the data to remove all the inline css and HTMl tag other than bold, italics, and para and then paste it as normal text.</p>
  
  <p>I have successfully detected the paste event by</p>
  
  <pre><code>document.getElementById('editor').addEventListener('paste', handlePaste);
  function handlePaste(e) {
    var clipboardData, pastedData;
    // Stop data actually being pasted into div
    clipboardData = e.clipboardData;
    pastedData = clipboardData.getData('text/html');
    e.stopPropagation();
    e.preventDefault();
  }
  </code></pre>
  
  <p>I'm able to manipulate the pastedData but not able to initiate the paste behaviour. Using preventDefault and stopPropagation I'm able to stop the default behaviour of paste, and also using getData I'm able to extract the data from clipboard. But now I'm stuck here, I'm not able to initiate paste event. In the docs it is said that we need to create a custom event like <strong>pasteClipboardData(newData)</strong>. But I could find any reference on how to create such event. </p>
  
  <blockquote>
    <p>// Since we are canceling the paste operation, we need to manually </p>
    
    <p>// paste the data into the document. </p>
    
    <p>pasteClipboardData(newData);</p>
  </blockquote>
  
  <p><a href="https://w3c.github.io/clipboard-apis/#override-paste" rel="nofollow noreferrer">https://w3c.github.io/clipboard-apis/#override-paste</a></p>