Angular Component for CodeMirror 6
To use this component in your project install it via npm
npm i @robotcoral/ngx-codemirror6 @codemirror/basic-setup --save
Include CodeMirrorModule
in your main module:
import { CodeMirrorModule } from "@robotcarol/ngx-codemirror6";
@NgModule({
// ...
imports: [CodeMirrorModule],
// ...
})
export class AppModule {}
and add the ngx-codemirror
selector to your feature component:
import { Component } from "@angular/core";
@Component({
selector: "sample",
template: ` <ngx-codemirror [config]="{...}"> </ngx-codemirror> `,
})
export class Sample {
// ...
}
You can pass an object of the type EditorStateConfig
to the ngx-codemirror component via the [config]
input.