From 3b0ebfe47b75191be385b9c526c92a3083d4e152 Mon Sep 17 00:00:00 2001 From: CN-Tower Date: Mon, 22 Oct 2018 17:07:59 +0800 Subject: [PATCH] Update monaco-diff-editor.component.ts --- .../monaco-editor/monaco-diff-editor.component.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/client/src/app/monaco-editor/monaco-diff-editor.component.ts b/client/src/app/monaco-editor/monaco-diff-editor.component.ts index 882d80b..f04185c 100644 --- a/client/src/app/monaco-editor/monaco-diff-editor.component.ts +++ b/client/src/app/monaco-editor/monaco-diff-editor.component.ts @@ -39,10 +39,6 @@ export class MonacoDiffEditorComponent extends MonacoEditorBase implements OnIni _originalModel: any; _modifiedModel: any; private _editor: any; - options: any = { - theme: '', - language: 'json' - }; constructor(private appService: AppService, public broadcast: SharedBroadcastService) { super(broadcast); @@ -63,18 +59,16 @@ export class MonacoDiffEditorComponent extends MonacoEditorBase implements OnIni if (!this._originalModel || !this._modifiedModel) { throw new Error('originalModel or modifiedModel not found for ngx-monaco-diff-editor'); } - const theme = this.appService.getAppTheme(); - this.options.theme = this.appService.getEditorTheme(theme); - this._originalModel.language = this.options.language; - this._modifiedModel.language = this.options.language; + this._originalModel.language = 'json'; + this._modifiedModel.language = 'json'; this._editorContainer.nativeElement.innerHTML = ''; const originalModel = win.monaco.editor.createModel(this._originalModel.code, this._originalModel.language); const modifiedModel = win.monaco.editor.createModel(this._modifiedModel.code, this._modifiedModel.language); - this._editor = win.monaco.editor.createDiffEditor(this._editorContainer.nativeElement, this.options); + this._editor = win.monaco.editor.createDiffEditor(this._editorContainer.nativeElement); this._editor.setModel({ original: originalModel, modified: modifiedModel