我有以下代码:
app.directive('ckEditor', [function () {
return {
require: '?ngModel',
link: function ($scope, elm, attr, ngModel) {
var ck = null;
var config = attr.ckSize;
ck = CKEDITOR.replace(elm[0]);
if (config == 'narrow') {
ck.resize(700, 357);
} else {
ck.resize(900, 357);
}
我正在尝试调整 ckEditor 实例的大小,但它给了我一条错误消息:
TypeError: Cannot call method 'setSize' of undefined
at CKEDITOR.editor.resize (http://127.0.0.1:81/Scripts/ckeditor/ckeditor.js:294:23)
有人可以就如何更改该编辑器大小的实例给我建议吗?