每当我尝试加载Ckeditor时,我都会收到"无法设置未定义的属性'dir'".我正在使用angular-cli来开发我的Angular2应用程序.
CKEditor版本:4.4.7
当我使用ng服务运行应用程序时.此问题不会重现,但是当我使用ssl运行此应用程序时,我得到了CKEditor的这个问题.
我在index.html中添加了basepath但仍面临问题.
我试过这个:1)
<script type="text/javascript">
window.CKEDITOR_BASEPATH = '//localhost/assets/axp-dev-portal/ckeditor/';
</script>
<script src="//localhost/assets/axp-dev-portal/ckeditor/ckeditor.js"></script>
Run Code Online (Sandbox Code Playgroud)
2)
<script type="text/javascript">
window.CKEDITOR_BASEPATH = '/assets/ckeditor/';
</script>
<script src="/assets/ckeditor/ckeditor.js"></script>
Run Code Online (Sandbox Code Playgroud)
3)
<script type="text/javascript">
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
</script>
<script src="/assets/ckeditor/ckeditor.js"></script>
Run Code Online (Sandbox Code Playgroud)
在document.ts文件中:
focusFunction() {
if (window['CKEDITOR'].instances['prodAPIDoc'] == undefined) {
window['CKEDITOR']['inline']('prodAPIDoc', { customConfig: '../../../assets/ckeditor/config.js' });
}
}
Run Code Online (Sandbox Code Playgroud)
document.html
<div id="prodAPIDoc" [attr.contenteditable]="isEditable"
style="text-align: left; position: relative;margin-left:5px;" [innerHTML]="documentation | sanitizeHtml"
(focus)="focusFunction()">
Run Code Online (Sandbox Code Playgroud)
我想使用ckeditor.js而不是ng2-ckeditor.
如何在angular2中实现ng2-editor为内联?
我将ng2-ckeditor实现为内联,但我收到以下错误.
错误:
vendor.abcb022….bundle.js:1262 EXCEPTION: Cannot set property 'dir' of undefinedt.handleError @ vendor.abcb022….bundle.js:1262next @ vendor.abcb022….bundle.js:736e.object.i @ vendor.abcb022….bundle.js:785e.__tryOrUnsub @ vendor.abcb022….bundle.js:1e.next @ …Run Code Online (Sandbox Code Playgroud)