Ameer Hamza
Ameer Hamza

Reputation: 87

Ngx-tinymce Uncaught TypeError: _this.onChange is not a function

I'm using ngx-tinymce 7.0.0 from here. In installation instructions it uses two-way data binding. It works fine with [(ngModel)]='html'. But when I remove [(ngModel)], following error appears in console, when I write something in editor :

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)

Do I've to use [(ngModel)]? Because two-way data binding is not considered as good practice.

Upvotes: 1

Views: 865

Answers (2)

Ameer Hamza
Ameer Hamza

Reputation: 87

I got solution for this. If you're not using [(ngModel)], you've to use [formControl] present in ReactiveFormsModule.

Upvotes: 1

Ankur Jain
Ankur Jain

Reputation: 221

I think tinymce is only worked with two way binding, so its mandate to use ng-model

Upvotes: 0

Related Questions