diff --git a/src/codemirror.component.ts b/src/codemirror.component.ts index 68d39f2..f31dfab 100644 --- a/src/codemirror.component.ts +++ b/src/codemirror.component.ts @@ -118,4 +118,7 @@ export class CodemirrorComponent implements AfterViewInit, OnDestroy { onTouched() {} registerOnChange(fn) { this.onChange = fn; } registerOnTouched(fn) { this.onTouched = fn; } + setDisabledState(isDisabled: boolean): void { + this.instance.setOption('readOnly', isDisabled ? 'nocursor' : isDisabled); + } }