Reputation: 552
From backend I receive an array of objects that contains text as one of the field. I would like to have ability to edit that text.
So far I have something like this:
<div *ngFor="let speech of speeches; index as i">
<div class="card">
<div class="card-header">
<div class="row">
//some other input fields
<div class="card-body">
<ckeditor [(ngModel)]=speech.content
[editor]="editor"
name={{i}}
required
[config]="ckeConfig"
debounce="500"
(change)="onChange($event)">
</ckeditor>
</div>
</div>
</div>
It works fine when speeches array is up to about 30-40 but for larger it even can cause the browser to crash.
Does anyone have faced this issue and resolved it?
Upvotes: 3
Views: 1860
Reputation: 3348
Each <ckeditor>
component takes ~5MB of memory because of the internal abstract model. It listens to various global events and also provides its own toolbar with various buttons, so the DOM is enlarged by the editor too.
For sure running such number of editors will slow down your page and we don't recommend it (It will happen with any editor because of the problems listed above). There might be a few more or less complicated solutions to that problem:
Upvotes: 5