ngx-monaco-editor icon indicating copy to clipboard operation
ngx-monaco-editor copied to clipboard

Editor doesn't load, if there is an element with id="monaco"

Open hesch opened this issue 2 years ago • 0 comments

If you follow the instructions from the README to setup a new project and add an <div id="monaco"></div> anywhere in your HTML, the editor won't load. This is caused by this line: https://github.com/atularen/ngx-monaco-editor/blob/94c1fe19061ee3a1b9d4a0587dd5c82f7c496f2e/projects/editor/src/lib/base-editor.ts#L30

which checks, if monaco is available. The problem is, that if there is an element with the id monaco window.monaco will return that element (instead of undefined). I have no idea if this is even fixable, but perhaps there is a better way to check if monaco is available?

hesch avatar Oct 30 '21 00:10 hesch