Ledzz / angular2-tinymce

Angular 2 component for TinyMCE MCE WYSIWYG editor
https://angular2-tinymce.surge.sh
66 stars 37 forks source link

Cannot read property 'parse' of undefined #12

Closed dineshk16feb closed 7 years ago

dineshk16feb commented 7 years ago

I am using tinymce like this, <app-tinymce [(ngModel)]="modelName">

I am getting error like this ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'parse' of undefined TypeError: Cannot read property 'parse' of undefined at L.setContent (http://localhost:4200/vendor.bundle.js:168904:6647) at TinymceComponent.writeValue (http://localhost:4200/vendor.bundle.js:131467:40) at http://localhost:4200/vendor.bundle.js:20920:27 at http://localhost:4200/vendor.bundle.js:22109:65 at Array.forEach (native) at FormControl.setValue (http://localhost:4200/vendor.bundle.js:22109:28) at http://localhost:4200/vendor.bundle.js:23515:60 at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invoke (http://localhost:4200/polyfills.bundle.js:2832:26) at Object.onInvoke (http://localhost:4200/vendor.bundle.js:4357:37) at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invoke (http://localhost:4200/polyfills.bundle.js:2831:32) at Zone.webpackJsonp.908.Zone.run (http://localhost:4200/polyfills.bundle.js:2592:43) at http://localhost:4200/polyfills.bundle.js:3227:57 at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invokeTask (http://localhost:4200/polyfills.bundle.js:2865:31) at Object.onInvokeTask (http://localhost:4200/vendor.bundle.js:4348:37) at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invokeTask (http://localhost:4200/polyfills.bundle.js:2864:36) at L.setContent (http://localhost:4200/vendor.bundle.js:168904:6647) at TinymceComponent.writeValue (http://localhost:4200/vendor.bundle.js:131467:40) at http://localhost:4200/vendor.bundle.js:20920:27 at http://localhost:4200/vendor.bundle.js:22109:65 at Array.forEach (native) at FormControl.setValue (http://localhost:4200/vendor.bundle.js:22109:28) at http://localhost:4200/vendor.bundle.js:23515:60 at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invoke (http://localhost:4200/polyfills.bundle.js:2832:26) at Object.onInvoke (http://localhost:4200/vendor.bundle.js:4357:37) at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invoke (http://localhost:4200/polyfills.bundle.js:2831:32) at Zone.webpackJsonp.908.Zone.run (http://localhost:4200/polyfills.bundle.js:2592:43) at http://localhost:4200/polyfills.bundle.js:3227:57 at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invokeTask (http://localhost:4200/polyfills.bundle.js:2865:31) at Object.onInvokeTask (http://localhost:4200/vendor.bundle.js:4348:37) at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invokeTask (http://localhost:4200/polyfills.bundle.js:2864:36) at resolvePromise (http://localhost:4200/polyfills.bundle.js:3179:31) [angular] at http://localhost:4200/polyfills.bundle.js:3230:17 [angular] at Object.onInvokeTask (http://localhost:4200/vendor.bundle.js:4348:37) [angular] at ZoneDelegate.webpackJsonp.908.ZoneDelegate.invokeTask (http://localhost:4200/polyfills.bundle.js:2864:36) [angular] at Zone.webpackJsonp.908.Zone.runTask (http://localhost:4200/polyfills.bundle.js:2632:47) [ => angular] at drainMicroTaskQueue (http://localhost:4200/polyfills.bundle.js:3060:35) [] at XMLHttpRequest.ZoneTask.invoke (http://localhost:4200/polyfills.bundle.js:2931:25) []

aandrade1234 commented 7 years ago

Same error here. @dineshk16feb did you find a way to solve this issue ? I think those TinyMCE issues should be related https://github.com/tinymce/tinymce/issues/3413 and https://github.com/tinymce/tinymce/issues/2722

robmeredith commented 7 years ago

Same here - I resorted to using <app-tinymce [formControl]="content"></app-tinymce> and initialising with:

this.content = new FormControl();
this.content.setValue(this.val);
this.content.registerOnChange((val) => this.val = val);

to bind model to 'val'

Vermorxt commented 7 years ago

+1

Ledzz commented 7 years ago

Latest release should close it. Can you please check?

reinaldovale commented 7 years ago

This problem continues, even in the "angular2-tinymce@2.1.2"

Ledzz commented 7 years ago

Can't reproduce on latest release. Please check that you updated package. Also, currently latest version is 2.1.1, not 2.1.2.