Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx-monaco-editor 9.0.0 not working for custome theme in angular 10 #263

Open
shruti-devurkar opened this issue Apr 27, 2023 · 0 comments
Open

Comments

@shruti-devurkar
Copy link

I am trying applu custom theme to ngx-monaco-editor but cannot see thenew styles being applied , the only thing I am confuse is the baseUrl, what it should point to?

here is my code:
monaco.ts

import { NgxMonacoEditorConfig } from 'ngx-monaco-editor';
export const monacoConfig: NgxMonacoEditorConfig = {
onMonacoLoad: function() {
monaco.editor.defineTheme('myCustomTheme', {
base: 'vs-dark',
inherit: true,
rules: [],
colors: {
"editor.background": "#ffa500",
}
});
monaco.editor.setTheme('myCustomTheme');
}
};

objective.module.ts:
import { monacoConfig } from './monaco';
import { FormsModule } from '@angular/forms';

@NgModule({
imports: [
CommonModule,
RouterModule,
HttpClientModule,
SharedModule,
MonacoEditorModule.forRoot()
],
providers: [{ provide: NGX_MONACO_EDITOR_CONFIG, useValue: monacoConfig}]

angular.json has glob:

{
"glob": "**/*",
"input": "node_modules/ngx-monaco-editor/assets/monaco",
"output": "./assets/monaco/"
},

<ngx-monaco-editor name="tab.title {{ i }}" [options]="tab.editorOptions"
[(ngModel)]="editorTabs[i].content">

export class TextEditorComponent implements OnInit, AfterViewInit, OnChanges {
@output() onCloseSubFileTab = new EventEmitter();
@input('cases') cases = [];
editorOptions = { theme: 'myCustomTheme', language: '', minimap: { enabled: false }, automaticLayout: true };
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant