angular - "ERROR TypeError: this.onChange is not a function"的原因是什么?

标签 angular ckeditor

我的代码是 here .

你能告诉我浏览器返回以下错误信息吗:

ERROR TypeError: this.onChange is not a function
at RichTextEditorComponent.forwardEvent (rich-text-editor.component.ts:39)
at Object.eval [as handleEvent] (RichTextEditorComponent.html:6)

我试图将“this”对象打印到控制台,它只返回“RichTextEditorComponent”对象。

最佳答案

您的 RichTextEditorComponent 内部有问题您声明的地方 onChangeonTouched类型为 function没有真正为他们分配实际功能。

onChange: (value:any) => {};
onTouched: () => {};

它应该重写如下(使用 = )
onChange = (value:any) => {};
onTouched = () => {};

关于angular - "ERROR TypeError: this.onChange is not a function"的原因是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60437595/

相关文章:

javascript - 将插入符号设置为在焦点 CKEditor 之后结束

JavaScript 鼠标开始位置

angular - appModule : StaticInjectorError(AppModule)[BASE_URL]: 中的 NullInjection 错误

javascript - Angular2 - OnInit 访问函数

Angular <mat-select> 下拉菜单不适用于 nebular 主题

angular - 类型 'Observable<UI[] | Promise<any>>' 不可分配给类型 'Observable<UI[]>' 。类型 'UI[] | Promise<any>' 不可分配给类型 'UI[]'

asp.net - 在 asp.net 上为 CKEditor 启用图像上传

javascript - 编辑器 : Remove selection and set cursor position at the end of selection

angular - 无法解析 rxjs

php - CKEditor 忽略了我的 CSS