Closed AiHaibara closed 5 years ago
I'm a rookie. I want to use monaco-editor(not ngx-monaco-editor) for a simple angular web demo (just for study). Can you tell me why window.require is not a function? why you can use window.require? Can you give me some advice?
declare const require: any;
(<any>window).require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); (<any>window).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' }); });
I'm sorry I don't have to write window.require(), just use require()
I'm a rookie. I want to use monaco-editor(not ngx-monaco-editor) for a simple angular web demo (just for study). Can you tell me why window.require is not a function? why you can use window.require? Can you give me some advice?
declare const require: any;