which there is no [(ngModel)] property. I will control the editor's content by directly accessing editor object:
editorInit(editor: monaco.editor.IStandaloneCodeEditor) {
// get value via editor.getValue();
// set value via editor.setValue();
// I will also change editor's model later, so setting ngModel maybe hard for me
}
But this leads to many errors when interacting with editor:
ERROR Error: _this5.onTouched is not a function
TypeError: _this5.onTouched is not a function
at monaco-editor.component.ts:194
at l.fire (event.ts:576)
at H.setValue (codeEditorWidget.ts:1609)
at codeEditorWidget.ts:1405
at l.fire (event.ts:576)
at o._emitOugoingEvents (viewModelEventDispatcher.ts:62)
at o.emitOutgoingEvent (viewModelEventDispatcher.ts:38)
at w.setHasFocus (viewModelImpl.ts:179)
at textAreaHandler.ts:307
at l.fire (event.ts:576)
at errors.ts:22
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:28282)
at ZoneDelegate.invokeTask (zone.js:420)
at Zone.runTask (zone.js:188)
at ZoneTask.invokeTask (zone.js:503)
at ZoneTask.invoke (zone.js:492)
at timer (zone.js:3034)
I want to use this component like
which there is no
[(ngModel)]
property. I will control the editor's content by directly accessingeditor
object:But this leads to many errors when interacting with editor:
So is there any solution to solve this?