...
let canvas: HTMLCanvasElement = document.getElementById("myChart") as HTMLCanvasElement;
// We can also do like this // let canvas: HTMLCanvasElement = <HTMLCanvasElement>document.getElementById("myChart");
// This one is accepted but not recommended // let canvas: any = document.getElementById("myChart");
this.ctx = canvas.getContext('2d');
...