在没有 apikey 的情况下使用带有 angular 6 的 tinyMCE(免费) [英] use tinyMCE with angular 6 without apikey (free)
问题描述
我尝试使用 angular 6 安装 tinyMCE.我正在关注 https://www.tiny.cloud/docs/integrations/angular2/.
I tried to install tinyMCE with angular 6. I am following the docs on https://www.tiny.cloud/docs/integrations/angular2/.
一切正常,但我必须有一个 apiKey 才能使用 tinyMCE 云.
Everything OK but I must to have an apiKey to use the tinyMCE cloud.
我收到错误消息:此域未在 TinyMCE Cloud 中注册.开始免费试用以了解我们的优质云服务和专业支持."
I got the error : "This domain is not registered with TinyMCE Cloud. Start a free trial to discover our premium cloud services and pro support."
我想使用没有 apiKey 的自托管版本.
I want to use the self hosted version without apiKey.
如文档中所述 https://www.tiny.cloud/docs/integrations/angular2/#loadingtinymcebyyourself 我们可以托管 tinymce.min.js 来禁用 apiKey.
So as explained on the doc https://www.tiny.cloud/docs/integrations/angular2/#loadingtinymcebyyourself we can hosting the tinymce.min.js to disable apiKey.
如何使用 angular 6 正确添加 tinymce.min.js ?
How to add tinymce.min.js properly with angular 6 ?
推荐答案
1) 为 angular 2+ 安装 tinymce :
安装 tinymce angular npm 模块
install tinymce angular npm module
npm install @tinymce/tinymce-angular
在 app.module.ts
import { EditorModule } from '@tinymce/tinymce-angular';
将 EditorModule 添加到 app.module.ts
imports: [
...,
EditorModule
]
2) 托管 tinymce JS
安装 tinymce npm 模块:
install the tinymce npm module :
npm install tinymce --save
在 angular.json 上导入样式
"styles": [
...,
"node_modules/tinymce/skins/lightgray/skin.min.css",
"node_modules/tinymce/skins/lightgray/content.min.css",
"node_modules/tinymce/skins/lightgray/content.inline.min.css"
]
在 angular.json
"script": [
...,
"node_modules/tinymce/tinymce.min.js",
"node_modules/tinymce/themes/modern/theme.js"
]
3) 在 HTML 文件上使用 tinyMCE
添加此代码以使用:
<editor [(ngModel)]="dataModel"></editor>
这篇关于在没有 apikey 的情况下使用带有 angular 6 的 tinyMCE(免费)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!