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

查看:52
本文介绍了ng2-ckeditor使用打字稿和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 -

我还创建了一个 朋克 .

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使用打字稿和angular 2.0添加占位符插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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