Is there a way to copy text in clipboard (multi-browser) in Angular2 Typescript framework?
I find only sources of using Javascript, e.g.
document.exe
Here is a simple code in case your text is not inside an input or textarea, but a div, or any other HTMLElement and you don't want to use any external libraries:
window.getSelection().selectAllChildren(document.getElementById('yourID'));
document.execCommand("copy");
I was unable to use the select() command because it wasn't recognized by Angular. Hope this helps someone!