Ledzz / angular2-tinymce

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

Error during startup #14

Closed reinaldovale closed 7 years ago

reinaldovale commented 7 years ago
EXCEPTION: Uncaught (in promise): TypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at L.setContent (eval at <anonymous> (http://10.139.5.173/js/app.ba93a84362fbc9a399d2.js:94:2359), <anonymous>:12:6163)
    at TinymceComponent.writeValue (eval at <anonymous> (http://10.139.5.173/js/app.ba93a84362fbc9a399d2.js:93:22912), <anonymous>:91:40)
...

My config

TinymceModule.withConfig({
      "menubar": false,
      "statusbar": false,
      "height": 250,
      "baseURL": "skins-tinymce",
      "language": 'pt_BR',
      "skin_url": "skins-tinymce/pdweb",
      "toolbar": "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image, table"
})

<app-tinymce [(ngModel)]="proposicao.fundamentacao"></app-tinymce>

angular: "2.3.0", Google Chrome: Versão 57.0.2987.110 (64-bit), webpack: "1.14.0",

thanks in advance

Slashwit commented 7 years ago

I have the same issue. My set up is ASP ,NET Core and webpack. The editor visibly loads correctly. If I refresh the page on the parent component, the error is gone, bindings work and all is well. When using router navigation to the parent component the error comes back.

juulderuysscher commented 7 years ago

I solved this error in the pull request linked below:

https://github.com/Ledzz/angular2-tinymce/pull/18

reinaldovale commented 7 years ago

18

It worked for me. Thank you.

Ledzz commented 7 years ago

Closing as well