atularen / ngx-monaco-editor

Monaco Editor component for Angular 2 and Above
https://www.npmjs.com/package/ngx-monaco-editor
MIT License
428 stars 155 forks source link

How to trigger an event from angular #203

Closed Djeffl closed 2 years ago

Djeffl commented 3 years ago

How do can I trigger an event in my component like the find (ctlr+f) event?

williamszwk commented 2 years ago

如何监听F8按钮事件~

williamszwk commented 2 years ago

ngx-monaco-editor 监听键盘按钮 Monitor keyboard

<ngx-monaco-editor (init)="onEditorInit($event)" ></ngx-monaco-editor>

onEditorInit(editor) {
    editor.addCommand(monaco.KeyCode.F8, () => {
      //回调事件
    })
}