We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5604908 commit 2a14a5aCopy full SHA for 2a14a5a
projects/coreui-angular-chartjs/src/lib/chartjs.component.ts
@@ -1,4 +1,5 @@
1
import {
2
+ afterRenderEffect,
3
booleanAttribute,
4
ChangeDetectionStrategy,
5
ChangeDetectorRef,
@@ -160,10 +161,12 @@ export class ChartjsComponent implements OnDestroy {
160
161
readonly ctx = computed(() => this.canvasElement()?.nativeElement.getContext('2d'));
162
163
constructor() {
- effect(() => {
164
- const ctx = this.ctx();
165
- if (ctx && !this.chart) {
166
- this.chartRender();
+ afterRenderEffect({
+ read: () => {
+ const ctx = this.ctx();
167
+ if (ctx && !this.chart) {
168
+ this.chartRender();
169
+ }
170
}
171
});
172
0 commit comments