简体   繁体   English

Angular6 和 tinyMCE 编辑器

[英]Angular6 & tinyMCE editor

Hello I would like to integrate tinyMCE editor in angular 6 application.您好,我想在 angular 6 应用程序中集成 tinyMCE 编辑器。

I have integrated as below thread, however it gives me message that the domain is not registered.I would like to do it without integrating it with API keys with few basic features.我已经按照下面的线程进行了集成,但是它给我的消息是该域未注册。我想在不将其与具有一些基本功能的 API 密钥集成的情况下执行此操作。

Link here to stackoverflow a In above thread it says it can be done using module Loader but I think it is given in AngularJS and not in angular6. 在这里链接到 stackoverflow在上面的线程中,它说它可以使用模块加载器来完成,但我认为它是在 AngularJS 中给出的,而不是在 angular6 中给出的。

If someone can help me with the same would be highly appreciable.如果有人可以帮助我,那将是非常可观的。

Following step by step guide outlines the process of loading TinyMCE and TinyMCE-Angular in your project managed by the Angular CLI.以下分步指南概述了在由 Angular CLI 管理的项目中加载 TinyMCE 和 TinyMCE-Angular 的过程。

Install TinyMCE using NPM使用 NPM 安装 TinyMCE

npm install --save tinymce

In your angular.json add tinymce to the global scripts tag.在您的 angular.json 中,将 tinymce 添加到全局脚本标记中。 Your script list might look like the following:您的脚本列表可能如下所示:

"scripts": [
  "node_modules/tinymce/tinymce.min.js"
]

Add tinymce skins, themes and plugins to the assets property of your angular.json.将 tinymce 皮肤、主题和插件添加到 angular.json 的资产属性。 This will allow Tiny to lazy-load everything it requires on initialization.这将允许 Tiny 延迟加载初始化所需的一切。

"assets": [
  { "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/" }
]

Finally, configure the editor.最后,配置编辑器。 If necessary, set the base_url and suffix options.如有必要,设置 base_url 和后缀选项。

<editor [init]="{
  base_url: '/tinymce', // Root for resources
  suffix: '.min',       // Suffix to use when loading resources
  plugins: 'lists advlist',
  toolbar: 'undo redo | bold italic | bullist numlist outdent indent'
}"></editor>

More info here: https://github.com/tinymce/tinymce-angular更多信息: https : //github.com/tinymce/tinymce-angular

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM