Ngx-tinymce Uncaught TypeError: _this.onChange is not a function
Ngx-tinymce Uncaught TypeError: _this.onChange is not a function
我正在使用 here 中的 ngx-tinymce 7.0.0
。在安装说明中,它使用双向数据绑定。它适用于 [(ngModel)]='html'
。但是当我删除 [(ngModel)]
时,控制台中出现以下错误,当我在编辑器中写一些东西时:
Uncaught TypeError: _this.onChange is not a function
at Aw.<anonymous> (ngx-tinymce.js:168)
at kg.c.fire (tinymce.min.js:2)
at Aw.fire (tinymce.min.js:2)
at Hg (tinymce.min.js:2)
at Object.t (tinymce.min.js:2)
at C (tinymce.min.js:2)
at HTMLBodyElement.d (tinymce.min.js:2)
我必须使用 [(ngModel)]
吗?因为双向数据绑定不被认为是好的做法。
我认为 tinymce 只能使用双向绑定,所以它必须使用 ng-model
我找到了解决方案。如果您不使用 [(ngModel)]
,则必须使用 ReactiveFormsModule
中的 [formControl]
。
我正在使用 here 中的 ngx-tinymce 7.0.0
。在安装说明中,它使用双向数据绑定。它适用于 [(ngModel)]='html'
。但是当我删除 [(ngModel)]
时,控制台中出现以下错误,当我在编辑器中写一些东西时:
Uncaught TypeError: _this.onChange is not a function
at Aw.<anonymous> (ngx-tinymce.js:168)
at kg.c.fire (tinymce.min.js:2)
at Aw.fire (tinymce.min.js:2)
at Hg (tinymce.min.js:2)
at Object.t (tinymce.min.js:2)
at C (tinymce.min.js:2)
at HTMLBodyElement.d (tinymce.min.js:2)
我必须使用 [(ngModel)]
吗?因为双向数据绑定不被认为是好的做法。
我认为 tinymce 只能使用双向绑定,所以它必须使用 ng-model
我找到了解决方案。如果您不使用 [(ngModel)]
,则必须使用 ReactiveFormsModule
中的 [formControl]
。