Closed matheusnicolas closed 2 years ago
Hey guys, I'm trying to use monaco.editor.create and I'm facing this error:
Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
how could I do this if I'm using ngx-monaco-editor and I want to configure my monaco-config.ts:
let editor = monaco.editor.create(document.getElementById('container'), { theme: 'my-theme', language: "my-language" });
My html angular code:
`
I tried to use window.onload, addEventListener but nothing works, I don't know how could I try to solve this problem. I suspect it's something because I already have the ngx component in the html, but I might be wrong.
I got it working, no worries!
@matheusnicolas what'd you change?
Hey guys, I'm trying to use monaco.editor.create and I'm facing this error:
Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
how could I do this if I'm using ngx-monaco-editor and I want to configure my monaco-config.ts:
let editor = monaco.editor.create(document.getElementById('container'), { theme: 'my-theme', language: "my-language" });
My html angular code:
`
I tried to use window.onload, addEventListener but nothing works, I don't know how could I try to solve this problem. I suspect it's something because I already have the ngx component in the html, but I might be wrong.