在角度2中(通过ng2-ckeditor)我正在尝试使用{cnitor cdn无法提供的CKEditor-ShowProtected-Plugin。
这就是我尝试遵循的原因:
import { CKEditorModule } from 'ng2-ckeditor';
declare var CKEDITOR:any;
CKEDITOR.plugins.addExternal('showprotected', '../assets/ckeditor-showprotected-plugin', 'plugin.js');
这是我的CKEDITOR_CONFIG
:
private CKEDITOR_CONFIG = {
'extraPlugins': 'showprotected',
...
}
然而,CKEDITOR.plugins.addExternal(..)
似乎没有被考虑在内,因为ckeditor仍在尝试从cdn中获取ckeditor-showprotected-plugin
:
error_handler.js:54 EXCEPTION: [CKEDITOR.resourceManager.load]
Resource name "showprotected" was not found at "https://cdn.ckeditor.com/4.5.11/full/../assets/ckeditor-showprotected-plugin?t=G87Eplugin.js".
答案 0 :(得分:0)
我没有机会在Angular 2中实现,但它在Angular 1.x中在CKEDITOR.editorConfig = function( config ) {
//end of configurations add following lines
config.extraPlugins += (config.extraPlugins.length == 0 ? '' : ',') + '<your_plugin_name>';
config.allowedContent = true;
}
ckeditor/plugins/
并在^\s{3}(?=\S)
文件夹