TheUnreal
TheUnreal

Reputation: 24492

Angular 2 update CKEditor textarea

Plunker: https://plnkr.co/edit/aUBtpe?p=preview

Using CKEditor, the content variable is not updated to the textarea value changes. It's stays the same as the orginal page.content variable received from the server.

the console.log(content) show the old data, without the changes I made to the textarea data.

Any ideas?

Upvotes: 2

Views: 1164

Answers (1)

John Siu
John Siu

Reputation: 5092

Multiple issues:

  1. You need ng2-ckeditor for ckeditor to work correctly with Angular2 framework.

  2. Angular2(latest is 2.1.1) is released now, and beta.0 is really old. Current release of ng2-ckeditor is base on Angular2 module import model, which was introduced in RC.5.

  3. To have ng2-ckeditor working, BOTH

    In index.html

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

    AND Module Import

    import { CKEditorModule } from 'ng2-ckeditor';
    
    @NgModule({
      // ... 
      imports:      [
        CKEditorModule
      ],
      // ... 
    })
    

    are required.

I created a working Plunker Here.

Upvotes: 1

Related Questions