title: Copy to clipboard from textarea in Angular
body: <p>I am trying to copy text from a HTML textarea, however I only found a solution with an Input tag like this: </p>
  
  <pre><code>&lt;input type="text" value="User input Text to copy" #userinput&gt;
  &lt;button (click)="copyInputMessage(userinput)" value="click to copy"&gt;Copy from Textbox&lt;/button&gt;
  </code></pre>
  
  <p>Function:</p>
  
  <pre><code>copyInputMessage(inputElement){
    inputElement.select();
    document.execCommand('copy');
    inputElement.setSelectionRange(0, 0);
  }
  </code></pre>
  
  <p>When I want to replace the input tag with a textarea tag it doesn’t work anymore.
  Is there an similar easy solution with a textarea?</p>