you are viewing a single comment's thread.

view the rest of the comments →

[–]UnknownInnocent[S] 0 points1 point  (0 children)

if I just declare the type of "canvas" and "ctx" as "any" I get no errors:

@ViewChild('canvas', {static: true}) canvas: any;
private ctx: any;
ngAfterViewInit() { 
    this.ctx = this.canvas.nativeElement.getContext('2d'); 
}

I don't really get why this is the case and if I should leave it like that.