Angular 如何在ng2 ace编辑器中禁用复制、粘贴和删除文本

Angular 如何在ng2 ace编辑器中禁用复制、粘贴和删除文本,angular,typescript,ace-editor,Angular,Typescript,Ace Editor,有没有办法在ng2 ace编辑器中禁用复制、粘贴和删除文本。 这是我在angular 5应用程序中使用的版本。您可以在github上受益于此版本 隐藏光标和线高光的步骤 editor.setOptions({ readOnly: true, highlightActiveLine: false, highlightGutterLine: false }) editor.renderer.$cursorLayer.element.style.opacity=0 使编辑器不

有没有办法在ng2 ace编辑器中禁用复制、粘贴和删除文本。
这是我在angular 5应用程序中使用的版本。

您可以在github上受益于此版本

隐藏光标和线高光的步骤

editor.setOptions({
    readOnly: true,
    highlightActiveLine: false,
    highlightGutterLine: false
})
editor.renderer.$cursorLayer.element.style.opacity=0
使编辑器不可选项卡化

editor.textInput.getElement().tabIndex=-1

禁用所有快捷方式

editor.commands.commmandKeyBinding={}

您可以从github上的这个问题中获益

隐藏光标和线高光的步骤

editor.setOptions({
    readOnly: true,
    highlightActiveLine: false,
    highlightGutterLine: false
})
editor.renderer.$cursorLayer.element.style.opacity=0
使编辑器不可选项卡化

editor.textInput.getElement().tabIndex=-1

禁用所有快捷方式

editor.commands.commmandKeyBinding={}

要禁用剪贴板,请添加以下命令:

editor.commands.addCommand({
    name: "breakTheEditor", 
    bindKey: "ctrl-c|ctrl-v|ctrl-x|ctrl-shift-v|shift-del|cmd-c|cmd-v|cmd-x", 
    exec: function() {} 
});
要禁用拖动,请使用

![
    "dragenter", "dragover", "dragend", "dragstart", "dragleave", "drop"
].forEach(function(eventName) {
    editor.container.addEventListener(eventName, function(e) {
        e.stopPropagation()
    }, true)
});
editor.setOption("dragEnabled", false)

要禁用剪贴板,请添加以下命令:

editor.commands.addCommand({
    name: "breakTheEditor", 
    bindKey: "ctrl-c|ctrl-v|ctrl-x|ctrl-shift-v|shift-del|cmd-c|cmd-v|cmd-x", 
    exec: function() {} 
});
要禁用拖动,请使用

![
    "dragenter", "dragover", "dragend", "dragstart", "dragleave", "drop"
].forEach(function(eventName) {
    editor.container.addEventListener(eventName, function(e) {
        e.stopPropagation()
    }, true)
});
editor.setOption("dragEnabled", false)
找到人民币的答案

找到人民币的答案


如果我设置了
readOnly:true
,则无法键入内容。我需要键入内容,但需要禁用复制、粘贴和删除内容如果我设置了
readOnly:true
,则我无法键入内容。我需要键入内容,但需要禁用复制、粘贴和删除内容谢谢,效果很好。禁用剪贴板使用键工作,但在浏览器中,我们在编辑菜单中有一个粘贴选项,如何防止?谢谢,效果很好。禁用剪贴板使用关键点工作,但在浏览器中,我们在编辑菜单中有一个粘贴选项,如何防止?