BlockCopyAndPaste Directives
This will block the copy and paste functionalities in the input box. use this directive to block this functionality
Save this directive and name it as blockCopyPaste
@HostListener('paste', ['$event']) blockPaste(event: keyboardEvent) {
event.preventDefault();
}
@HostListener('copy', ['$event']) blockCopy(event: keyboardEvent) {
event.preventDefault();
}
@HostListener('cut', ['$event']) blockCut(event: keyboardEvent) {
event.preventDefault();
}
1 Comments
ctest
ReplyDelete