简体   繁体   English

如何将预定义和自定义ckeditor插件添加到ng2-ckeditor

[英]How to add predefined and custom ckeditor plugins to ng2-ckeditor

I am trying to add the stylesheetparser plugin to the ng2-ckeditor module on inline mode of ckeditor in angular2. 我正在尝试将angularsheet2的内联模式下的stylesheetparser插件添加到ng2-ckeditor模块中。 But i am getting the output in the styles dropdown with an right square bracket and also the "Source" button in ckeditor is missing. 但是我在带有右方括号的样式下拉列表中得到输出,而且ckeditor中的“源”按钮也丢失了。

eg: div.editable] 例如:div.editable]

I am using the following codes to add the plugin, 我正在使用以下代码添加插件,

CKEDITOR.config.extraPlugins = 'stylesheetparser'; CKEDITOR.config.extraPlugins ='stylesheetparser';

CDN version of ckeditor used is " https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js " 所使用的ckeditor的CDN版本是https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js

Please help me to find a solution for it. 请帮助我找到解决方案。

Thanks in Advance 提前致谢

Add this code is html and ts file. 添加此代码是html和ts文件。 Hope so it will work fine. 希望它能正常工作。

Component.ts Component.ts

ckeConfig : any;
this.ckeConfig = {
   height: 500,
   width: '60%',
   allowedContent: false,
   fullPage : true,
   toolbar: [
       { name: "styles", items: ['Format', 'Font', 'FontSize', "-", "TextColor", "BGColor"] },
       { name: "basicstyles", items: ["Bold", "Italic", "Underline", "RemoveFormat"] },
       "/",
       { name: "justify", items: ["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"] },
       { name: "paragraph", items: ["NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "Blockquote"] },
       { name: "links", items: ["Link", "Unlink"] },
       { name: "insert", items: ["Image", "Table", "HorizontalRule", "Smiley","SpecialChar"] },
       { name: "document", items: ["Source"] },
   ]
 };

Component.html :- Component.html:-

<ckeditor [config]="ckeConfig" ></ckeditor>

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

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