在不使用apikey的情况下使用tinyMCE和angular 6 [英] use tinyMCE with angular 6 without apikey (free)

查看:1109
本文介绍了在不使用apikey的情况下使用tinyMCE和angular 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装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)安装tinymce for angular 2 +:

安装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的情况下使用tinyMCE和angular 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆