Search code examples
angularckeditor

ng2-ckeditor ngModel doesn't update, events not firing


I've successfully plugged in ng2-ckeditor into my application, and the editor loads with the text supplied via ngModel. However when I type, the value in ngModel doesn't change, and the change and editorChange events don't fire. The ready event does fire.

Consider the following:

  <ckeditor
    [(ngModel)]="testContent"
    [config]="editorConfig"
    (change)="onChange($event)"
    (editorChange)="onEditorChange($event)"
    debounce="500">
  </ckeditor>

editorConfig = {
  skin: 'bootstrapck',
  height: 400,
  extraPlugins: 'divarea'
};

At first I was building multiple ck-editors by ngForing through an observable list, but was finding that the model content wasn't being fired. I simplified it down to the above without it being in a loop, but it's still not working.

Am I mis-understanding how this is supposed to work, or could this be a bug?

  • angular 6.1.4
  • ng2-ckeditor 1.2.1
  • ckeditor 4.10.1

Solution

  • The issue seemed to be around the build of ckeditor I'd created from the website. I re-downloaded ckeditor (without doing the custom build), manually added the skin I need and the 'divarea' plugin into the assets directory, then it all seems to work fine.