Monaco editor creating an instance without providing the editor container

325 Views Asked by At

I want to inject the Monaco editor html code through javascript. However, the create function for the editor always asks for the container div.

monaco.editor.create(document.getElementById('container-div'),{options})

Is there an option to create the instance without providing the wrapper and storing it in a variable so that I can use it or inject it via javascript later on?

1

There are 1 best solutions below

0
On

Not sure what the problem is. Just create a new HTML element as container and use that for injection.