yabab-dev / ng2-ckeditor

Angular2 CKEditor component
MIT License
358 stars 96 forks source link

CKEditor Uncaught TypeError: Cannot call method 'unselectable' of null in angularjs 2 can't able to destroy previous loaded ckeditor #44

Closed akashkuber-tudip closed 7 years ago

akashkuber-tudip commented 8 years ago

I have a CKEditor as window['CKEDITOR_BASEPATH'] = '//cdn.ckeditor.com/4.5.9/standard/'; and i am not able to destroy it for load other CKEditor in a different module. getting the error Cannot call method 'unselectable' of null in angular js 2 .

inzerceubytovani commented 8 years ago

I confirm this problem - when I go outside page which CKEeditor module before CKEditor is initialized (displayed), I got that error or sometimes those errors: EXCEPTION: null is not an object (evaluating 'c.setState'), TypeError: undefined is not an object (evaluating 'f.body'), EXCEPTION: undefined is not an object (evaluating 'a.filter.customConfig')

yabab-dev commented 8 years ago

Can you make a plunker to reproduce the problem ?

Thanks !

Neeeek commented 7 years ago

Hi. I get this error too: EXCEPTION: Cannot read property 'unselectable' of null I use angular 2 with webpack and I haven't got a SystemJS Config. Editor was loaded in my view, but not working. If I click on any button in editor I get the error: TypeError: Cannot read property 'hasFocus' of undefined I don't know how to create plunker with part of my project.

yabab-dev commented 7 years ago

Hi @Neeeek You can fork this one : https://embed.plnkr.co/hnB0R3/

Neeeek commented 7 years ago

@chymz I go step by step in tutorial.

  1. Add link in index.html;
  2. Import to main module file import {CKEditorModule} from "ng2-ckeditor" and add to imports;
  3. Paste <ckeditor [(ngModel)]="content" [config]="configEditor" debounce="500"></ckeditor> in my template;
  4. Open the page with this editor and get errors. Cannot read property 'unselectable' of null
Neeeek commented 7 years ago

My bad, I found mistake. Problem is in modal window. I get this error cuz I paste the editor in modal window. Mb you know how to fix this? I found some solution, but it's not a good idea I think

yabab-dev commented 7 years ago

If you can make a sample repo or plunker, maybe I can help you. But for now, i dont have enough informations...

zeflq commented 7 years ago

@chymz i got the same error , i just removed the instance from CKEDITOR #106

pbapan commented 6 years ago

Hi im referring to below plnkr

https://embed.plnkr.co/hnB0R3/ with 4.8.0 ckeditor bundle.

the issue I have is when I set the content, it doesn't display in editor. import { Component } from '@angular/core';

@Component({ selector: 'ckeditorangularcomponent', template: <ckeditor [(ngModel)]="content" [config]="ckEditorConfig" debounce="500"> </ckeditor> , }) export class CKEditorAngularComponent { private content: string; private height: number; private width: any; constructor() { this.content = <p>Greetings from CKEditor...</p>; }

in browser when I view the source I can see "Greetings from CKEditor..." but it is not visible in editor. did I do anything wrong.

And aslo if you can add some info on below post that would be great https://stackoverflow.com/questions/48332068/ckeditor-wordcount-unable-to-find-in-cdn

hamzii commented 6 years ago

in app.blade.php change

to