CKEditor占位符角2

时间:2017-09-14 10:56:09

标签: angular typescript ckeditor placeholder

我在使用ng2-ckeditor时遇到了一些问题,我需要在其上放置占位符,但我真的不知道如何在角度2中执行此操作

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

使用配置是否有解决方案?我试过了

    this.config.placeholder = 'some value';

但它不起作用

2 个答案:

答案 0 :(得分:1)

这里是如何在placeholder中添加CKEditor-5

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

See docs

答案 1 :(得分:0)

添加JS:

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

此处添加 extraPlugins:'placeholder' in [config]

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

希望这有帮助!