ng2-ckeditor 使用 typescript 和 angular 2.0 添加占位符插件 [英] ng2-ckeditor Add Placeholder plugin using typescript and angular 2.0

查看:16
本文介绍了ng2-ckeditor 使用 typescript 和 angular 2.0 添加占位符插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 CKEditor 工具栏中获取占位符插件,但是在将 extraPlugins:'placeholder' 添加到 CKEditor 配置时出现以下错误 -

I am trying to get placeholder plugin in the CKEditor toolbar but getting following error when adding extraPlugins:'placeholder' to CKEditor config -

Error: [CKEDITOR.resourceManager.load] Resource name "placeholder" was not found at "//cdn.ckeditor.com/4.5.9/standard/plugins/placeholder/plugin.js?t=G6DD".

这是控制台日志截图 -

Here is console log screenshot -

我还创建了一个 plunker.

I have also created a plunker.

我已经通过 npm 安装了 "ng2-ckeditor": "^1.0.4".

I have installed "ng2-ckeditor": "^1.0.4" via npm.

我能得到一些帮助吗?

推荐答案

你应该使用:

<script src="https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js"></script>

并且你应该在你的 CKEdior 标签中使用:

and you should use in your CKEdior tag:

<ckeditor
  [(ngModel)]="sampleContent"
  [config]="{uiColor: '#a0a0a0',extraPlugins:'placeholder'}"
  debounce="500">
</ckeditor>

你可以使用:

(change)="onChange($event)"

但你必须在你的组件中定义:

but you must define in your Component:

onChange(body:any) {
 //your Code
}

这篇关于ng2-ckeditor 使用 typescript 和 angular 2.0 添加占位符插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆