Search code examples
javascriptangularckeditorangular-formsckeditor5

How to use CKEditor in Angular 4?


  1. I install CKEditor using npm install ng2-ckeditor this command.
  2. Then add ckeditor.js in my index.html
  3. Then import import { CKEditorModule } from 'ng2-ckeditor'; in app.module.ts
  4. And then use CKEditor in my HTML page

     <ckeditor ngModel="{{ckeditorContent}}" formControlName="circular_contents" [config]="{uiColor: '#99000'}" [readonly]="false" debounce="500" debounce="500">
     </ckeditor>
    
  5. At that time i get the error ERROR TypeError: Cannot set property 'dir' of undefined

Now how can i use CKEditor in my HTML page.


Solution

  • everything is ok just include ckeditor cdn link in your index.html page, don't download ckeditor.js.

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