The correct way of avoiding the warning is to host the library yourself, as pointed out in Nathan Goings' answer (which IMO should be the accepted one).
If you are integrating TinyMCE in an Angular project using the @tinymce/tinymce-angular package, you can override the library source path by defining a provider:
import { Component } from '@angular/core';
import { TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';
import { RawEditorOptions } from 'tinymce';
@Component({
selector: 'tiny-editor',
template: '<editor [init]="editorOptions"></editor>',
providers: [
{ provide: TINYMCE_SCRIPT_SRC, useValue: 'assets/tinymce.min.js' }
]
})
export class TinyEditorComponent {
editorOptions: RawEditorOptions = {
base_url: '/assets',
height: 500,
menubar: false,
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table paste code help wordcount'
].join(' '),
toolbar:
`undo redo | formatselect | bold italic backcolor |
alignleft aligncenter alignright alignjustify |
bullist numlist outdent indent | removeformat | help`
}
}
Don't forget to update the architect build step in your angular.json
file, to include the tinymce files into your public assets folder:
{
...
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"assets": [
...
{
"glob": "**/*",
"input": "./node_modules/tinymce/",
"output": "./assets/"
}
...
]
}
...
}
...
}
For more information, check this guide on how to integrate a self-hosted TinyMCE instance in an Angular app.