gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 16:41:15 25 4
gpt4 key购买 nike

我的代码是 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com