简体   繁体   English

如何启用微型MCE插件?

[英]How to Enable a Tiny MCE Plugin?

So I've never used tinymce before and I'm working on a project in which it has already been installed. 因此,我以前从未使用过tinymce,并且正在从事已经安装过tinymce的项目。 I copied the code from the docs here: 我从这里的文档中复制了代码:

tinymce.init({
  selector: "textarea", // change this value according to your HTML
  plugins: "advlist"
});

But I have no clue where this init function needs to go in order to be called. 但是我不知道该init函数需要去哪里才能被调用。

Tiny is simply being used to have an email text editor and the line that calls on tinymce (I think) is this: Tiny仅用于拥有电子邮件文本编辑器,而调用tinymce(我认为)的行是这样的:

<app-tinymce formControlName='emailBody'></app-tinymce>

Thanks! 谢谢!

After tinymce library and html is loaded (insert this after <script src={tinymcelib}></script> ) you should call 在tinymce库和html加载后(在<script src={tinymcelib}></script>之后插入),您应该调用

<script>
  tinymce.init({
    selector: "html node to mount editor.
    plugins: "list of plugins to use"
  });
</script>

eg. 例如。 to mount editor to element <textarea id="editor"> with plugin advlist, you would call it like that: 使用插件advlist将编辑器安装到元素<textarea id="editor">时,您将这样称呼它:

<script>
  tinymce.init({
    selector: "#editor"
    plugins: "advlist"
  });
</script>

You will also want to reference the TinyMCE Angular docs, you are using the init function that is more for a vanilla HTML/JS approach. 您还将需要参考TinyMCE Angular文档,您正在使用init函数,该函数更多地用于原始HTML / JS方法。 Not knowing the exact set up it's hard to say what's going on, but here's the link to the Tiny Angular docs: https://www.tiny.cloud/docs/integrations/angular2/ 不知道确切的设置,很难说是怎么回事,但这是Tiny Angular文档的链接: https : //www.tiny.cloud/docs/integrations/angular2/

And here's the link to the Tiny Angular wrapper on GitHiub: https://github.com/angular-ui/ui-tinymce 这是GitHiub上Tiny Angular包装器的链接: https : //github.com/angular-ui/ui-tinymce

Hopefully that helps, sounds like a tough situation! 希望有帮助,听起来像是一个艰难的境地!

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

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