materiahq / ngx-monaco-editor

Monaco Editor Library for Angular v6 and above
MIT License
159 stars 35 forks source link

editorOptions configuration problem #49

Closed tanjie123 closed 3 years ago

tanjie123 commented 3 years ago

Version: "@materia-ui/ngx-monaco-editor": "^5.0.0" 、"monaco-editor": "^0.22.3"

Usage: <ngx-monaco-editor fxFill #codeEditor [options]="editorOptions" [(ngModel)]="note.content" (init)="editorInit($event)" (keyup)="send()"> </ngx-monaco-editor> editorOptions = { theme: 'vs-dark', language: 'markdown', minimap: { enabled: false, }, wordWrap: "on", };

Got the problem:

ERROR in src/main/webapp/app/note/note-editor/note-editor.component.html:182:59 - error TS2322: Type '{ theme: string; language: string; minimap: { enabled: boolean; }; wordWrap: string; }' is not assignable to type 'IStandaloneEditorConstructionOptions'. Types of property 'wordWrap' are incompatible. Type 'string' is not assignable to type '"on" | "off" | "wordWrapColumn" | "bounded" | undefined'.

182 <ngx-monaco-editor #codeEditor [options]="editorOptions" [(ngModel)]="note.content"

Thank you!!!

tanjie123 commented 3 years ago

When i config as follow, it's ok. editorOptions: MonacoEditorConstructionOptions = { theme: 'vs-dark', language: 'markdown', minimap: { enabled: false, }, wordWrap: "on", };