-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I get the Text of the Model #37
Comments
editor.getValue() Though do note that the scope of the editor variable above will not work. So declare var editor before the require and assign it in the require callback function. Alternatively: monaco.editor.getModels()[0].getValue() |
I see... I was trying things off the monaco.editor object, it makes sense that'd it be on the editor instance that was created. Thanks for clearing that up. |
Is that the best way to get the array of lines? |
@stoplion No, that would be |
Probably a dumb question but I'm having an awful hard time with it.
I loaded up the easy sample, and all I want to do is get the text out that the user has entered.
This is proving hard for me to find
If I add a function
How would I go about doing that?
The only method I've found is something like
monaco.editor.getModels()[0]._lines
which would give me the line objects array and in turn I could get at_text
of each line. I'm assuming this is not the way it was meant to be done.Any pointers appreciated.
I created a Stack Overflow question asking the same thing with the
monaco-editor
tag, but I thought i'd probably have better luck asking here since this is so new.The text was updated successfully, but these errors were encountered: