tinymce / tinymce-angular

Official TinyMCE Angular Component
MIT License
330 stars 92 forks source link

base_url seems to do nothing #113

Closed ahadjithoma closed 5 years ago

ahadjithoma commented 5 years ago

What is the current behavior? this is my editor:

<editor   [init]="{
    base_url: '/tinymce', 
      suffix: '.min',       
      menubar: false,
      branding: false,
      statusbar: false,
      plugins: 'lists, textcolor' 
    }"  [(ngModel)]="value"  [inline]="true" [disabled]="isDisabled"></editor>

but i get the follow errors image

it seems that base_url is not applied at all!

SimonFc commented 5 years ago

What version of TinyMCE are you using? The base_url and suffix options were added in ver. 5.0.8

ahadjithoma commented 5 years ago

I was using tinymce 4.8. I run yarn add @tinymce/tinymce-angular@latest and i thought that i will get the latest tinymce also. After yarn add tinymce@latest , base_url works as expected

pwilkowski commented 4 years ago

This is still not working, I have tinymce 5.1.6 and tinymce looks for their resources in / directory so it completely skips base_url

workaround is to change this in angular.json

{ "glob": "**/*", "input": "node_modules/tinymce/skins", "output": "/tinymce/skins/" },
{ "glob": "**/*", "input": "node_modules/tinymce/themes", "output": "/tinymce/themes/" },
{ "glob": "**/*", "input": "node_modules/tinymce/plugins", "output": "/tinymce/plugins/" }

to this:

{ "glob": "**/*", "input": "node_modules/tinymce/skins", "output": "/skins/" },
{ "glob": "**/*", "input": "node_modules/tinymce/themes", "output": "/themes/" },
{ "glob": "**/*", "input": "node_modules/tinymce/plugins", "output": "/plugins/" }

Original solution was found here: https://stackoverflow.com/a/57419965/325606