Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
477 views
in Technique[技术] by (71.8m points)

javascript - ng2-ckeditor Add Placeholder plugin using typescript and angular 2.0

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 - enter image description here

I have also created a plunker.

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

Can i get some help ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

you should use that:

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

and you should use in your CKEdior tag:

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

and you can use :

(change)="onChange($event)"

but you must define in your Component:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...