Search code examples
clipboardionic-frameworkcordova-plugins

Copy to Clipboard on hybrid apps and browsers


I'm coding with ionic framework and ngCordova and targeting to both mobile devices and browsers. When the user presses a button I want to copy text to the clipboard.

I'm aware that ngCordova is mainly for mobile devices, but is there a way to run the same code for the purpose above on both platforms without also using zeroClipboard and ngClip?

Cheers


Solution

  • No. Because browsers has limits on clipboard use from JavaScript as a fundamental security measure. There is no way around this except utilities such as zeroClipboard.