Within my AngularJS application, I am attempting to utilize a dummy input element to copy a string into the clipboard. The code snippet below is triggered when the 'on-share-link-made' event is broadcasted, setting the value of the input element correctly. However, despite this, the window.document.execCommand() function does not seem to have any effect.
$scope.$root.$on('on-share-link-made', function (event, args) {
var input = $('#MyInput')[0];
input.value = args.uri;
input.select();
window.document.execCommand("copy");
});