Ckeditor5-angular: the [data]="text" property not updates if text variable was changed

Created on 29 Jun 2020  路  7Comments  路  Source: ckeditor/ckeditor5-angular

Hello guys. I noticed some interesting behavior with ckeditor5-angular. So regular template of the editor:

 <ckeditor
    [config]="config"
    [data]="text"
    [editor]="Editor"
    (change)="handleChange($event)"
  ></ckeditor>

if the text property was changed by @Input() after the config is set - so text can't be changed inside the editor anymore.
For example:
I set up the field. set the config. text is still undefined. Editor loads with no text inside.
The @Input() receive variable text changes - and there some text already. But it isn't going forward to the <ckeditor> component. It does not affect this change of [data] unfortunately. As for me - it happened because change detection does not work as should inside component.
BTW we could use ngModel,

 <ckeditor
    [config]="config"
    [(ngModel)]="text"
    [editor]="Editor"
    (change)="handleChange($event)"
  ></ckeditor>

and it will be automatically updated/bound/etc, but - the question is - is it a non-overengineering way for this case? or do we need to have the working DI there? Am I wrong?

bug integrations

Most helpful comment

any update on this

All 7 comments

@ma2ciek, can you take a look at it?

This is my question as well.

Sorry guys for the late response, I'll take a look.

any update on this

has anyone solved this problem?

This topic is quite large (detecting the input properties changes) and the data property is not the only one that can be changed runtime. I reported this issue in #264.

Hi guys, soon 1 year anniversary of this case. Nothing special, but I think any dev meet this issue want to ask why so obvious bugs don't fix for so long time? there no problem with runtime, it's just about data binding. Anyway, hope you will resolve this issue sometime.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ma2ciek picture ma2ciek  路  9Comments

Karman40 picture Karman40  路  5Comments

codertushar picture codertushar  路  8Comments

Ruud-cb picture Ruud-cb  路  10Comments

ma2ciek picture ma2ciek  路  9Comments