I have an Angular2 component with a method to paste data from the clipboard:
inputPaste(event){ let clipboardData = event.clipboardData; ...
}
This method does not work for IE10 +, but IE has a window object with the bufferboardData property, but the typescript compiler throws an error:
inputPaste(event){ let clipboardData = event.clipboardData || window.clipboardData; //error 'clipboardData' does not exist on type Windows ...
}
I found a solution that we should use the angular2 -clipboard directive, but I will not use it.
How can I use 'windows.clipboardData' in typescript?
source share