Last active
          February 29, 2020 13:05 
        
      - 
      
- 
        Save daniel12fsp/bde565f43a02a66f1ab2360828408dbc to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //function stolen from https://dev.to/aligoren/building-url-shortener-with-mongodb-express-framework-and-typescript-4a71 | |
| function saveClipBoard(text) { | |
| // Textarea allow to use newline("\n") | |
| const textarea = document.createElement('textarea'); | |
| document.body.appendChild(textarea); | |
| textarea.value = text; | |
| textarea.select(); | |
| const success = document.execCommand('copy'); | |
| document.body.removeChild(textarea); | |
| return success; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment