Skip to content

[nz-code-editor] Configure MonacoEnvironment before (first) load #6502

@Airblader

Description

@Airblader

What problem does this feature solve?

Since monaco-editor 0.22.0¹, the global monaco object is only defined if you add

window.MonacoEnvironment = { globalAPI: true };

It would be nice if ng-zorro had some hook to configure MonacoEnvironment (also for potential other use-cases) before monaco-editor is actually loaded. Also, the documentation for onLoad is now slightly incorrect/incomplete:

The hook invoked when the resource of monaco editor is loaded. At this moment and afterwards the global variable monaco is usable

¹ https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md

What does the proposed API look like?

Extend NzConfig#codeEditor with either an object or a function to modify MonacoEnvironment.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions