Created
July 11, 2016 07:08
-
-
Save gridsurfer/18ea0ba3b35f08c851333ad870b96fd7 to your computer and use it in GitHub Desktop.
monaco-editor-test1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > | |
</html> | |
<body> | |
<h1>Monaco editor test1</h1> | |
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div> | |
<script src="node_modules/monaco-editor/min/vs/loader.js"></script> | |
<script> | |
require.config({ paths: { 'vs': 'node_modules/monaco-editor/min/vs' }}); | |
require(['vs/editor/editor.main'], function() { | |
var editor = monaco.editor.create(document.getElementById('container'), { | |
value: [ | |
'function x() {', | |
'\tconsole.log("Hello world!");', | |
'}' | |
].join('\n'), | |
language: 'javascript' | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment