Skip to content

Commit

Permalink
feat: add theme and mode to json-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
belsman committed Sep 17, 2024
1 parent 7f2d183 commit d7fc509
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
OnDestroy,
} from '@angular/core';
import ace from 'ace-builds';
import 'ace-builds/src-noconflict/mode-json';
import 'ace-builds/src-noconflict/theme-monokai';

@Component({
selector: 'rc-json-editor',
Expand All @@ -30,7 +32,6 @@ export class JSONEditorComponent implements AfterViewInit, OnDestroy {
value: this.value,
});

// Seems we have to import it manually in both cases...
this.editor.setTheme('ace/theme/monokai');
this.editor.session.setMode('ace/mode/json');
}
Expand All @@ -39,11 +40,4 @@ export class JSONEditorComponent implements AfterViewInit, OnDestroy {
this.editor.destroy();
this.editor.container.remove();
}

// editor.session.on('change', function (delta) {
// /*
// delta { start: number, end: number, line: array of changes, action: string }
// */
// console.log(editor.getValue());
// });
}

0 comments on commit d7fc509

Please sign in to comment.