【问题标题】:How to add predefined and custom ckeditor plugins to ng2-ckeditor如何将预定义和自定义 ckeditor 插件添加到 ng2-ckeditor
【发布时间】:2017-12-29 16:17:21
【问题描述】:

我正在尝试在 angular2 中 ckeditor 的内联模式下将 stylesheetparser 插件添加到 ng2-ckeditor 模块。但是我在带有右方括号的样式下拉列表中得到了输出,并且 ckeditor 中的“源”按钮也丢失了。

例如:div.editable]

我正在使用以下代码添加插件,

CKEDITOR.config.extraPlugins = 'stylesheetparser';

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

请帮我找到解决办法。

提前致谢

【问题讨论】:

    标签: javascript angular ckeditor


    【解决方案1】:

    添加这段代码是html和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 :-

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

    【讨论】:

    • 感谢您的回复哈琳。实际上我得到了正确的ckeditor结构,但我的问题是关于样式表解析器插件的输出,我在上面的例子中提到了一个正确的方括号以及元素。
    • 这没有回答问题。
    猜你喜欢
    • 1970-01-01
    • 2017-12-18
    • 2020-02-27
    • 1970-01-01
    • 1970-01-01
    • 2017-12-18
    • 2014-04-01
    • 2010-11-11
    • 2015-12-19
    相关资源
    最近更新 更多