Jędrek Markowski
Jędrek Markowski

Reputation: 444

CKEditor placeholder angular 2

i've got some troubles with ng2-ckeditor, I need to put placeholder on it, but I dont really know how to do this in angular 2

 <ckeditor
            [config]="config"
            [(ngModel)]="text"
            [ngModelOptions]="{standalone: true}"
            (change)="updateRemainingCharacters()"
 >
 </ckeditor>

Is there solution for that using config? I tried

    this.config.placeholder = 'some value';

but it doesn't work

Upvotes: 2

Views: 2496

Answers (2)

WasiF
WasiF

Reputation: 28859

Here is how you can add placeholder in CKEditor-5

  <ckeditor [config]="{ placeholder:'Placeholder Text', toolbar: [ 'bold', 'italic', 'bulletedList' ] }">
  </ckeditor>

See docs

Upvotes: 2

Abhay Dixit
Abhay Dixit

Reputation: 1018

Add JS:

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

Here add extraPlugins:'placeholder' in [config]

<ckeditor
  [(ngModel)]="text"
  [config]="{extraPlugins:'placeholder'}">
</ckeditor>

Hope this helps!

Upvotes: 0

Related Questions