2017-09-14 103 views
0

我已经得到了一些麻烦与NG2-CKEditor的,我需要把占位符就可以了,但我真的不知道如何在角2CKEditor的占位符角2

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

做到这一点是有解决方案可为使用配置?我试图

this.config.placeholder = 'some value'; 

,但它不工作

+0

看看这篇文章,其中提供了一个完整的示例以及链接库:https://stackoverflow.com/questions/46119865/angular-4-add-ckeditor-to-component-ts?noredirect=1 #comment79205692_46119865 –

回答

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> 

希望这有助于!

+0

感谢您的回复,但它不起作用您是否知道如何在此占位符中定义任何文本并添加其他配置的占位符? –

+0

好吧,这是一些误解,我需要在常见输入中包含诸如占位符之类的东西,比如'放置文本在这里...',任何时候我都会将该文本放在该文件上消失 –

+0

我认为这会对您有所帮助:https:// stackoverflow.com/questions/28301703/how-do-i-add-a-placeholder-attribute-to-an-instance-of-ckeditor – Aby