1๐
โ
You need to wrap <app-chartjs></app-chartjs>
inside *ngIf
or simply try this in <app-chartjs>
<div [hidden]="!chart">
<canvas class="my-4 w-100" id="canvas" width="900" height="380">{{chart}}</canvas>
</div>
1๐
you have to create the new chart only in ngAfterViewInit()
Source:stackexchange.com